View Full Version : Form and URL

04-17-2011, 04:00 PM
Hi there,

I have a form that sends an email. Is there any way that when the user clicks "submit", it could also send the url that the form was sent from?

Bit of a odd request but hey.


04-17-2011, 04:40 PM
You could use $_SERVER['HTTP_REFERER'] (http://php.net/manual/en/reserved.variables.server.php), though people can suppress it from their browser.

You could have a hidden variable with $_SERVER['REQUEST_URI'], but people can easily amend the html using tools like firebug.

If you need to make it reliable, make use of $_SESSION