Jump to content

Glen_S

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Glen_S's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am not a coder, so please bear with me. I have used this program called web form designer to create a few forms now, all of them using their sample php script that I modified for my own use (as per their tutorial). Here is the problem, and I have just noticed it when someone pointed out that they are getting errors trying to use the email form and I could not figure out why as it worked fine for me. What happened is, when I registered my domain I did not bother to reigister it with the www prefix, just mydomain.com. The trouble is, when someone types a www.mydomain.com it takes them to my page ok, then if they go to the contact me page and fill out the email form, the referring url does not match the current www url, and I get this error: ERROR: You do not have permission to use this script from another URL. Referer: www.mydomain.com This URL: mydomain.com I have this form on a few sites now, so I am eager to know how I can fix this and still make sure the email is coming from my page. I was thinking I could delete the code that checks for the referring url, but I'd sooner not just do this. This is the code in the script that runs when someone presses submit: // Get the URL of this page $this_url = strtolower($_SERVER['HTTP_HOST']); // If the referring URL and the URL of this page don't match then // display a message and don't do download or send the email. if ($referer != $this_url) { echo "ERROR: You do not have permission to use this script from another URL. \n"; echo "Referer: " .$referer . "\n"; echo "This URL: " .$this_url. "\n"; exit; } Like I said, I do not know php well enough to do this, is there a way to modify this so I can still ensure my emails are coming from my page, but avoid the error when someone uses the www prefix? thanks in advance
×
×
  • 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.