not sure if I can use 2 else’s in a row, i’m basically just trying to make sure the var $email contains . and @
[php]<?php
$action=$_REQUEST[‘action’];
if ($action=="") /* display the contact form /
{
?>
Your name:
Your email:
Your message:
<?php
}
else / send the submitted data */
{
$name=$_REQUEST[‘name’];
$email=$_REQUEST[‘email’];
$message=$_REQUEST[‘message’];
function testEmail($email) {
if (preg_match ( “/.|@/”, $email))
else
echo “Email not OK”;
if (($name=="")||($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!”;
}
}
?>[/php]