469,310 Members | 2,635 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,310 developers. It's quick & easy.

Embedding a URL as an argument to a CGI program

Is this possible - I imagine so but cannot at the moment fathom out how
to do it!

Entering into the URL field in a browser the name of a cgi program like
this:

http://myserver/cgi-bin/prog

No problem

When prog has arguments, send them like this:

http://myserver/cgi-bin/prog?arg1=X&arg2=Y

Now prog needs an argument which is itself a URL so:

http://myserver/cgi-bin/prog?arg1=X&...?arg1=17&arg2=
299 ... etc.

How can I embed the URL which is the value to be sent into arg_url?

This worked (to my surprise):

http://myserver/cgi-bin/prog?arg1=X&...=prog2?arg1=17

but as soon as I tried to add more &arg2= ten the browser errored

I experimented with replacing the & for %38% and the = with %61% but
seem unable to successed - am I using the incorrect approach?

Appreciate any help you guys can give!

BTW the reason is that I want prog to be a generic program which
generates a frameset with one window containing the conetents of
whatever URL it is passed - building generic code.

cheers

--

jeremy
Jul 23 '05 #1
3 1450

Jeremy wrote:

Is this possible - I imagine so but cannot at the moment fathom out how
to do it! Entering into the URL field in a browser the name of a cgi program like this: http://myserver/cgi-bin/prog No problem When prog has arguments, send them like this: http://myserver/cgi-bin/prog?arg1=X&arg2=Y Now prog needs an argument which is itself a URL so: http://myserver/cgi-bin/prog?arg1=X&...?arg1=17&arg2=
299 ... etc. How can I embed the URL which is the value to be sent into arg_url? This worked (to my surprise): http://myserver/cgi-bin/prog?arg1=X&...=prog2?arg1=17 but as soon as I tried to add more &arg2= ten the browser errored I experimented with replacing the & for %38% and the = with %61%
but
seem unable to successed - am I using the incorrect approach? Appreciate any help you guys can give! BTW the reason is that I want prog to be a generic program which
generates a frameset with one window containing the conetents of
whatever URL it is passed - building generic code. cheers


You have to URL-encode the "&" and "?". Actually, the "&" is what throws
it off. Simply replace "&" with "%26" and "?" with "%3F" before you
construct the CGI query.

Sincerely,
Dmitri
http://www.1-script.com/install/
Check out my CGI scripts installation offer
-------------------------------------
##-----------------------------------------------#
Article posted with Web Developer's USENET Archiv
http://www.1-script.com/forum
no-spam read and post WWW interface to your favorite newsgroup -
comp.infosystems.www.authoring.html - 7697 messages and counting
##-----------------------------------------------##
Jul 23 '05 #2
In article <hS*********************@news.easynews.com>, www.1-script.com
says...

You have to URL-encode the "&" and "?". Actually, the "&" is what throws
it off. Simply replace "&" with "%26" and "?" with "%3F" before you
construct the CGI query.


Thanks very much Dmitiri, this is just what I was looking for.

--
jeremy
Jul 23 '05 #3
In article <hS*********************@news.easynews.com>, www.1-script.com
says...
You have to URL-encode the "&" and "?". Actually, the "&" is what throws
it off. Simply replace "&" with "%26" and "?" with "%3F" before you
construct the CGI query.

Actually still having some trouble with this - do I also need to url-
encode the = characters as well?
--

jeremy
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Roose | last post: by
1 post views Thread by gavinpaterson | last post: by
3 posts views Thread by newshop | last post: by
6 posts views Thread by mistabean | last post: by
reply views Thread by DevEng | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.