BigGuy2 Posted September 28, 2010 Posted September 28, 2010 On beres-expert.heliohost.org, Contact page, I have set up a box where someone can write a message and by clicking the button below it, the message should get sent as an e-mail to an e-mail adress, using php mail function. Unfortunately, I receive an error, 500 Internal Server Error. I tested this script on another hosting server and it worked. What can I do to fix this? I await your answer, Thank you
Byron Posted September 28, 2010 Posted September 28, 2010 First you might try checking your Error logs at your cpanel right after you recieve the 500 Error. Second, try posting your script for somebody to debug.
BigGuy2 Posted September 28, 2010 Author Posted September 28, 2010 This is what's written in the error log right after I get the error : [Tue Sep 28 12:38:24 2010] [error] [client 188.24.232.215] File does not exist: /home/bigguy/public_html/500.shtml, referer: http://beres-expert.heliohost.org/contact.php This is the script I use : <?php $from=$_POST['from']; $to='beresimob@yahoo.com'; $subject=$_POST['subject']; $message=$_POST['body']; mail($to, $subject, $message, 'From: '.$from); header('index.php'); ?> The information in the POST array is taken from the form on the Contact page.
Byron Posted September 28, 2010 Posted September 28, 2010 Replace: header('index.php'); With: header("location:index.php"); exit;
BigGuy2 Posted September 28, 2010 Author Posted September 28, 2010 It works now, thank you very much!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now