Jump to content

What does this do please, in an email form? http_referrer = getenv


11Tami

Recommended Posts

When you follow a link, your browser usually sends the address of the place you came from.  That code grabs that address.  If it's an email form, it's probably being grabbed to verify that the email form was called from your site, rather than any other site.

It can be spoofed though, so be careful that your script is not abused by spammers.
Link to comment
Share on other sites

Thank you very much, it looks like my email php is missing something then. For instance.

$formurl = "http://mywebsite.com/formpage.html" ;//The address of my page with the form and fields on it.<br />
$email = $_POST['email'] ;//The email address of the person filling out the form.<br />
if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; }
I don't understand what the above "if" command is supposed to do regarding the formurl and the email.

But even as importantly, there seems to be something missing with the http_referrer.
This is how it looks in my php email form.
$http_referrer = getenv( "HTTP_REFERER" );
But there is no "if" statement for this saying if the form isn't being sent from my site
there should be an error or an exit. Does someone have anything to go it that I can use? I already looked at the php manual with no luck. Please let me know, Tami.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.