Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Best way to generate URLs in CGI script?

by synapse0 (Pilgrim)
on Jul 27, 2001 at 05:59 UTC ( [id://100206]=note: print w/replies, xml ) Need Help??


in reply to Best way to generate URLs in CGI script?

basically, the creating a new object should have worked..
$cgi = new CGI; #your basic info from QUERY_STRING or STDIN $other_cgi = new CGI($query_string); # $query_string is the url info t +o escape
then use $other_cgi->param($param) to obtain the params...
$other_cgi is a different object than $cgi at this point..
Hope that helps..
-Syn0

Replies are listed 'Best First'.
Re: Re: Best way to generate URLs in CGI script?
by bikeNomad (Priest) on Jul 27, 2001 at 06:18 UTC
    I tried this first, but what happened is that the query string got interpreted as a keyword. Let's say that I wanted the (relative) URL to be graph?a=b&c=d :

    my $target = CGI->new( 'graph' ); $target->param( -a => 'b', -c => 'd' ); $target->url; # 'http://localhost/cgi/originalPath' $target->query_string; # 'keywords=graph' $target->param; # 'keywords'

    So this didn't work...

      Ok.. well I can honestly say I'm not sure what you're trying to do then.. are you trying to call an external program and give it the query string?? if so, you can just set $ENV{QUERY_STRING} to your string, and exec the other cgi.. Otherwise, I need a little clarification..
      (i'm at work right now and only half paying attention, that may have something to do with it...)
      -Syn0
        I've got an image that's generated by another CGI script. So I want to generate something that looks like:

        <img src="graph&channel=1&xsize=300&ysize=400">

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://100206]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found