Click here to get back home

Embedding a URL as an argument to a CGI program

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Embedding a URL as an argument to a CGI program Jeremy 01-14-2005
Get Chitika Premium
Posted by Jeremy on January 14, 2005, 7:57 pm
Please log in for more thread options
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&arg2=Y&arg_url=prog2?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&arg2=Y&arg_url=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


Posted by www.1-script.com on January 15, 2005, 12:47 am
Please log in for more thread options

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&arg2=Y&arg_url=prog2?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&arg2=Y&arg_url=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 Archive

http://www.1-script.com/forums

no-spam read and post WWW interface to your favorite newsgroup -

comp.infosystems.www.authoring.html - 7697 messages and counting!

##-----------------------------------------------##


Posted by Jeremy on January 15, 2005, 10:04 am
Please log in for more thread options
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




Posted by Jeremy on January 19, 2005, 3:20 pm
Please log in for more thread options
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


Similar ThreadsPosted
embedding + mouseover September 24, 2004, 12:45 am
embedding media player September 30, 2004, 11:58 am
Embedding a Form in an HTML E-Mail - Possible? September 16, 2004, 7:10 am
Embedding a DVD movie to an HTML page March 10, 2005, 9:57 pm
Embedding external content - impossible? May 10, 2005, 6:45 pm
embedding images in HTML with the data URL src January 28, 2006, 1:26 am
Legality of embedding YouTube videos? February 1, 2007, 2:31 pm
Embedding a sound file without launching player March 31, 2005, 5:20 am
css program February 16, 2005, 10:57 pm
New Sitemap Program June 20, 2005, 8:47 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap