in reply to Writing link on HTML page

Here's an update in case anyone's interested. I studied another script that does print a link correctly, and applied its approach to this one as follows:

In the form, I name the input "continue" like this:
<input type="hidden" name="continue" value="http://www.webmonkeydean.com/et-toi/">

In the script I assigned a value to "$JUMP_URL" like this:
$JUMP_URL="$fields{'continue'}";

and wrote the links like this:
<a href="$fields{'continue'}">Continue</a>

This works for the "you already voted" html page, which is a simple page to generate. But it does not work for the "results" page, which is printed by the script in 3 or 4 sections. In that page the link for "continue" shows up as empty quotes ("") instead of the URL.

I'm going to try turning off buffering by adding $|=1; to the second line and see it that fixes it. I'll let you know how it goes. Thanks for tuning in!

Replies are listed 'Best First'.
Re: Re: Writing link on HTML page
by Deanimal (Acolyte) on Nov 05, 2002 at 22:54 UTC
    That didn't work either. Oh well.

      I'm assuming you've got something like this going on:

      • Page One - hidden input field with JUMP URL in it
      • Page Two - reads hidden input field, creates continue link
      • Page Three - attempts to read hidden input field, doesn't find it, creates empty continue link
      The reason you're not getting the link on page three is that to pass the url value from Two to Three, you'd need a form on Page Two with the same hidden input field, and the 'Continue' link would have to submit the form for the value to be available on the next page.

      What I'm trying to say is, the form values are only present on page Two - page Three has no knowledge of them.

      I suggest you look at the CGI material in the Tutorials section!