Need help with simple php/html contact form


#1

Can someone please help me clean this up or tell me what I’m doing wrong? Something is not right because on the page, where it should go into the SUBMIT section, the code is displayed on the page.

<?php $action=$_REQUEST['action']; if ($action=="") /* display the contact form */ { ?>
<form  action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="submit">
Your name:<br>
<input name="name" type="text" value="" size="30"/><br>
Your email:<br>
<input name="email" type="text" value="" size="30"/><br>
Your message:<br>
<textarea name="message" rows="7" cols="30"></textarea><br>
<input type="submit" value="Send email"/>
</form>
<?php
} 

else /* send the submitted data */
{
$name=$_REQUEST[‘name’];
$email=$_REQUEST[‘email’];
$message=$_REQUEST[‘message’];
if (($name=="")||($email=="")||($message==""))
{
echo “All fields are required, please fill <a href=”">the form again.";
}
else{
$from=“From: $name<$email>\r\nReturn-path: $email”;
$subject=“Message sent using your contact form”;
mail(“contact[member=88428]kznow[/member].org”, $subject, $message, $from);
echo “Email sent!”;
}
}
?>

This is what I get…


example.PNG


#2

What is the url you are using?


#3

its kznow.org/contact.htm


#4

PHP code is invoked when the extension is .php. Anthing else will not interpret the code.


#5

I feel stupid. You’re right. My brain is fried. Haven’t even done php since 3.
TY