Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
We recently got a new director who's doing R&D for some Internet stuff and he's a bit of an asp lover. After I stopped laughing I set out to show him the power of PERL. So here's our first project - Set up some Google Ad Campaigns and create some web pages promoting one of our new services.

Easy enough. But then I thought, there's got to be a good way to track all these visits by various keywords and campaigns. So they're all pointing to a Perl script that slurps the Query_String (from the Google Ad Campaign) and points the requests to the proper destination. The Query_String is also split into its constituent parts and stuffed into a DB. Good so far. Then I thought I'd like to push along the Query_String to maintain some sort of state and measure the depth of each visit.

There is an initial landing page which I move the Query_String over by:
print "Location: $Landing_1?$ENV{'QUERY_STRING'}&id=$id\n";
Where $Landing_1 is the URL and $id is a timestamp (we're not looking for 100% accuracy).

Viewers have now clicked on a Google Ad Campaign and are peacefully resting on our initial landing page with the Query_String in tow. (eg. Here's where I faulter.

On this page I have a form that requests the user to choose the state she or he lives in. This is required by our legal team because we're not allowed to offer this service to various states. Once they do the drop down menu and submit, and they are welcomed, I relocate them to another page but I'd like to carry over the Query_String. So I tried this:
print "Location: $Landing_2?$ENV{'QUERY_STRING'}\n";
The script accepts the state value with:
my $state = param("state");
And based upon it's condition it is passed to the $Landing_2. But when the $Landing_2 comes up, the Query_String does not follow. $Landing_2 is a short request form. I need them to fill this out and go on to $Landing_3. I would like to push the Query_String along yet again.

What I'm trying to achieve is when I go to $Landing_2, I'd like to bring along the ID so I can Update my DB with this new depth level. And again when I go to $Landing_3.

I am not interested in using Cookies at this point.

My questions boils down to this. Does form submission eradicate the Query_String? If using POST?


In reply to Pushing along the Query_String by peppiv

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2021-06-14 23:57 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (66 votes). Check out past polls.