Forum Moderators: coopster & phranque

Message Too Old, No Replies

using anchors for form run cgi scripts

         

liamskoyles

11:09 pm on Jul 27, 2005 (gmt 0)

10+ Year Member



How can i use named anchors in my cgi script if it is being run off an html form.

There was a previous posting about this topic that ended by realizing a cgi script of the form /script.cgi?action=go#section but how can I do this using an html form. Because environment variables are passed with hex code for non alphanumeric characters it is imposible to simply include a pound symbol in the last passed variable. Thanks so much for the help

-Liam Skoyles

moltar

11:23 pm on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The server can never get the value of the anchor if that is what you are asking. I don't really understand what the problem is...

liamskoyles

11:36 pm on Jul 27, 2005 (gmt 0)

10+ Year Member



I am trying to create a cgi script that outputs an html webpage right? Well I want to know if there is any way to have an anchor be at the end of the URL created by the html form when it calls the cgi script. This way it would be like having a regular html webpage and anchor except the html would have been created by the cgi script.

I hope thats a little more clear

Liam Skoyles

WWMike

4:36 am on Jul 28, 2005 (gmt 0)

10+ Year Member



Pass the anchor to the cgi as a separate parameter such as:

/cgi-bin/script.cgi?parm1=pagename&parm2=anchorname

liamskoyles

2:10 pm on Jul 28, 2005 (gmt 0)

10+ Year Member



once the anchor is passed as in the env string how do you get html to zip down to that point in the page?

the whole point about anchors is that they go at the end of a url and tell the html code to go to that anchor, but if the last portion of the url is created by the html form, how do you tack an anchor on the end for the html to go to?

-Liam Skoyles

moltar

3:18 pm on Jul 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you want your resulting page to scroll down after the form submit? In that case just add the anchor at the end of the action string:

<form action="/cgi-bin/form.pl#anchor">

liamskoyles

3:38 pm on Jul 28, 2005 (gmt 0)

10+ Year Member



Haha... yea that works perfectly...

I feel rather foolish for not realizing that by myself.

Thanks alot for your help

-Liam