in reply to Printing URL to webpage

Use CGI; it will help you accept parameters much more cleanly.

...but this is a rolled script from bignosebird.com. Check to make sure "continue" is actually put into the $fields variable (it's not), or, just change the following lines:

$SHOW_RESULTS=1; # $JUMP_URL="$ENV{'HTTP_REFERER'}"; # $JUMP_URL="$fields{'continue'}"; $JUMP_URL=q[http://www.webmonkeydean.com/et-toi/];

You are attempting to get the variables before they are even put into the %fields hash. Either move the hashing north (or the $JUMP_URL south) or rewrite it with CGI.pm

Hope this helps, and good luck to you.

John J Reiser
newrisedesigns.com

Replies are listed 'Best First'.
Re: Re: (nrd) Printing URL to webpage
by Deanimal (Acolyte) on Nov 06, 2002 at 15:49 UTC
    Thanks John,

    I don't understand everything you said yet, but I'll study it.

    Here's another question: You told me why this doesn't work; but it does work for the "you already voted" webpage which is printed by the same script. Why does it work for that page but not the "results" page?

      The reason the link works when a user has already voted is because the script isn't using the same variable used in the main page ($fields{continue} instead of $JUMP_URL). This works because the subroutine that prints the "You already voted" message calls yet another subroutine that populates %fields with the proper information (your "continue" hidden field).

      The error doesn't use $JUMP_URL, which is assigned nothing earlier in the script, it uses $fields{continue} which by that time has what you want in it.

      John J Reiser
      newrisedesigns.com

Re: Re: (nrd) Printing URL to webpage
by Deanimal (Acolyte) on Nov 06, 2002 at 16:20 UTC
    It sounds like you're saying it's a little more involved than I thought, and I need to actually *learn* Perl (imagine that!) to do what I'm trying to do. Well, I'd like to get the survey to work in the meantime, so I'll stop trying to enter the URL as a variable and instead just hardcode the URL directly into the script. This means I'll have to have a separate script for each survey (I have 2), but at least it will work while I learn how to use the variable.