Need help with simple php/html contact form

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…


What is the url you are using?

its kznow.org/contact.htm

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

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

Sponsor our Newsletter | Privacy Policy | Terms of Service