That's quite an old script you've found somewhere. The ereg() function is deprecated as of PHP 5.3.0 and I'd like to think the version your using is more current, perhaps not though. Instead of sanitising the website (which is wrong in its current state) and email why not validate them using the preg_match function and error if false; its normally better to define what is allowed than remove everything that's not or test for everything that's not.

I'd imagine the ereg is causing problems so get it changed to preg_match.

Edited by CPD, 30 December 2012 - 06:30 PM.

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

"One of my most productive days was throwing away 1000 lines of code."

Make sure the "seanmcpeak@comcast.net" is where you want the test to be sent.

Run the script on your GoDaddy server. If you get "success", make sure the mail is delivered. If it was, then we know it is a problem in your code above. If not, then something on the server is not configured properly.

Make sure the "seanmcpeak@comcast.net" is where you want the test to be sent.

Run the script on your GoDaddy server. If you get "success", make sure the mail is delivered. If it was, then we know it is a problem in your code above. If not, then something on the server is not configured properly.

Then your host does not have a working MTA (Mail Transfer Agent) you can use, and thus you're unable to send e-mails via the mail () function.As for the functions listed above that you didn't understand, the PHP manual is a great resource for explaining them.

I recommend, first and foremost, to read up on the basics of PHP. Having the basic knowledge in place will allow you to better understand what you're working on, and thus have a better chance at making something work.Once you've done that, I strongly recommend that you dismiss the script above, as it's seriously outdated and insecure. Instead you should take a look at PHPmailer, and use it for your contact script.

Lastly, if you can't get that to work, then you need to change hosts.

PS: Please use the [code][/code] tags around your code, as it helps make both your post and your code a lot easier to read.

Then your host does not have a working MTA (Mail Transfer Agent) you can use, and thus you're unable to send e-mails via the mail () function.As for the functions listed above that you didn't understand, the PHP manual is a great resource for explaining them.

I recommend, first and foremost, to read up on the basics of PHP. Having the basic knowledge in place will allow you to better understand what you're working on, and thus have a better chance at making something work.Once you've done that, I strongly recommend that you dismiss the script above, as it's seriously outdated and insecure. Instead you should take a look at PHPmailer, and use it for your contact script.

Lastly, if you can't get that to work, then you need to change hosts.

PS: Please use the tags around your code, as it helps make both your post and your code a lot easier to read.

Thanks man. I'll get to reading and check out PHPmailer. Great resources. Cheers.