11Tami Posted November 30, 2006 Share Posted November 30, 2006 Hi, I need to know why this is in my email form and what it does? Thank you very much. Tami. $http_referrer = getenv( "HTTP_REFERER" ); Quote Link to comment Share on other sites More sharing options...
btherl Posted November 30, 2006 Share Posted November 30, 2006 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. Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted November 30, 2006 Share Posted November 30, 2006 http://php.net/getenv Quote Link to comment Share on other sites More sharing options...
paul2463 Posted November 30, 2006 Share Posted November 30, 2006 have a look here in the <a href="http://uk.php.net/getenv">Manual</a> Quote Link to comment Share on other sites More sharing options...
11Tami Posted December 2, 2006 Author Share Posted December 2, 2006 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 sitethere 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.