Forum Moderators: open

Message Too Old, No Replies

How to grab the url and post to it

         

kevinj

2:19 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



I have a simple form in an include file that will appear on all pages of the site. When it is submitted, I need it to always post to whatever page the user is on currently. Is there a way to grab the url from the current page so I can make the post go to the same page for the action of the form?

Thanks,
Kevin

defanjos

2:41 pm on Jul 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe this does it:
Request.ServerVariables("SCRIPT_NAME")

bsterz

3:19 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



You can also say:

<form method="POST" action="">

This tells the form to post to itself. One caveat - this will append all URL variables to the request as it uses the entire get string for the post.

Bill

kevinj

3:45 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



Thanks guys. I used the script_name and it worked great. Really appreciate both your help.

Kevin