Beginner PHP Mail Function Issue + Server Error

So I'm a super beginner to PHP, but I'm currently building my first website and I wanted to have a contact form on the site that a user can fill out, and then have their information be sent to an email. So I wrote the PHP for this using the "mail()" function, but for some reason whenever the user hits submit, it just goes to a page with the code on it and not the page I linked it to in the echo statement. Here's my PHP:\[code\]<?php $name = $_POST['name'];$email = $_POST['email'];$phone = $_POST['phone'];$message = $_POST['message'];$formcontent="From: $name \n Phone: $phone \n Message: $message";$recipient = "[email protected]";$subject = "Contact Form";$mailheader = "From: $email \r\n";mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");$url = 'contact.html';echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">' ?>\[/code\]And here's my html:\[code\]<div id="emailform"> <form action="mail.php" method="POST"> Name: <input type="text" name="name"> Email: <input type="text" name="email"> Phone: <input type="text" name="phone"> Message: <textarea name="message" rows="6" cols="25"></textarea><br /> <input type="submit" value="http://stackoverflow.com/questions/15801669/Send"><input type="reset" value="http://stackoverflow.com/questions/15801669/Clear"> </form></div>\[/code\]My final problem is related to the web server/host that I use (hostgator). For some reason, whenever I upload any documents that contain PHP in them, I get a 500 Internal Server Error and I'm not really sure what's going on there. If any of you know what I'm talking about, it would be great if you had advice.Thanks so much for reading all this and helping out.
 
Back
Top