Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Pushing along the Query_String

by tcf22 (Priest)
on Jul 08, 2003 at 13:34 UTC ( #272275=note: print w/replies, xml ) Need Help??


in reply to Pushing along the Query_String

If you are using CGI.pm, then there is a way to accept a query string if using a POST. You will need to uncomment a line. Its line 448 in version 2.752.
# Some people want to have their cake and eat it too! # Uncomment this line to have the contents of the query string # APPENDED to the POST data. # $query_string .= (length($query_string) ? '&' : '') . $ENV{'QUERY_ST +RING'} if defined $ENV{'QUERY_STRING'};
This will give you access to the CGI params, but if you just want the whole string in $ENV{QUERY_STRING}, then you need to put it in your form tag.
<FORM method=POST action="test.cgi?$ENV{QUERY_STRING}">

Then again you could just do something like this.
<INPUT type="hidden" name="query_string" value="$ENV{QUERY_STRING}">
Then access it in the next cgi like this
my $query_string = $cgi->param('query_string');

Replies are listed 'Best First'.
Re: Re: Pushing along the Query_String
by peppiv (Curate) on Jul 08, 2003 at 14:16 UTC
    Thanks for the help. I didn't want to break into the CGI.pm and make any changes. So I tried you're other two possibilities to no avail. The Google Ad Campaign gets me to the first landing page with this URL:

    http://www.newservice.com/new_offer.html?src=google&c=D1&ag=2&kw=discount+family&id=1057670384

    It's a flat html file with a form in it. When I tried to add the Query_String, it wouldn't accept it's value. I was able to push it along once using JavaScript and the location.search method. But I couldn't get it to read from there.

    Any other ideas are more than welcome!

    peppiv

      It's a flat html file with a form in it.

      Well that's the problem right there. You're either going to have to convert that to an SSI or a cgi script or put a modperl handler on top of it -- you need to jam the incoming query params onto the form so they're passed along.

      -derby

      update: There may be a javascript solution but my brain doesn't even want to go there.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2021-06-25 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (136 votes). Check out past polls.

    Notices?