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"/>

else /* send the submitted data */
if (($name=="")||($email=="")||($message==""))
echo “All fields are required, please fill <a href=”">the form again.";
$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?




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.