Hi everyone,
I need to create a simple email form and this is my first attempt to write php. Anyhow, I found this code on the internet:
Anyhow, I have tried to put this up on the server just to see what it looked like and when you open the email.php page, a dialog box pops up asking if I'd like to open the file or save it. Yes, my first step is to even get a php page to display on the net without this dialog box popping up. What am I doing wrong?
Thanks!
Ha1ls45
I need to create a simple email form and this is my first attempt to write php. Anyhow, I found this code on the internet:
Code:
<html>
<head><title></title></head>
<body>
<?php
if(!isset($_POST[\'submit\'])) {
// Form code
?>
<form method=\"post\" action=\"email.php\">
Name: <input type=\"text\" name=\"name\"><br>
Email: <input type=\"text\" name=\"email\"><br>
Subject: <input type=\"text\" name=\"subject\"><br>
Message:<br>
<textarea cols=10 rows=30 name=\"message\"></textarea><br>
<input type=\"submit\" name=\"submit\" value=\"Send\">
</form>
<?php
} else {
// Processing code
$headers = \"From: \".$_POST[\'name\'].\" <\".$_POST[\'email\'].\">\\r\\n\";
.\"Reply-To: \".$_POST[\'name\'].\" <\".$_POST[\'email\'].\">\\r\\n\";
mail(\"", $_POST[\'subject\'], $message, $headers);
}
?>
</body>
</html>
Anyhow, I have tried to put this up on the server just to see what it looked like and when you open the email.php page, a dialog box pops up asking if I'd like to open the file or save it. Yes, my first step is to even get a php page to display on the net without this dialog box popping up. What am I doing wrong?
Thanks!
Ha1ls45