I'm struggling with this email code and I'm not php freak since I'm
starting to learn php stuff. Could use some help...
It seems that I get too many parse errors all over and cannot figure
went wrong since most of these appears right to me...
<?PHP
$to = "scoobyood@jace 41.com" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$subject = $_POST['subject'] ;
$message = $_POST['message'] ;
//validate contact fields
if (!strstr(trim($ _POST['email']),"@"))
{
$email_error = "<p class='comment' >please enter your email
address!</p><br>";
$contact = "no";
}
if ($_POST['name'] == "")
{
$name_error = "<p class='comment' >name field is blank!</p><br>";
$contact = "no";
}
if ($_POST['email'] == "")
{
$email_error = "<p class='comment' >email field is blank!</p><br>";
$contact = "no";
}
if ($_POST['subject'] == "")
{
$subject_error = "<p class='comment' >subject field is
blank!</p><br>";
$contact = "no";
}
if ($_POST['message'] == "")
{
$message_error = "<p class='comment' >message field is
blank</p><br>";
$contact = "no";
}
if ($contact != "no")
{
//if pass, then submit email and redirect to thankyou page
mail($to, $subject, $message, "From: $name <$email>");
{
header("Locatio n: contactsent.htm l");
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<link href="css/jace2.css" rel="stylesheet " type="text/css" />
</head>
<body>
<p class="topic">U nable to send your message!</p><br>
<?PHP
//list error(s)
else if $send == "no");
{
echo "$name_erro r";
echo "$email_err or";
echo "$subject_error ";
echo "$message_error ";
}
?>
<p> Click your browser's "back" ; button to return to the
contact form and fill missing fields.<br>
</p>
</body>
</html>
starting to learn php stuff. Could use some help...
It seems that I get too many parse errors all over and cannot figure
went wrong since most of these appears right to me...
<?PHP
$to = "scoobyood@jace 41.com" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$subject = $_POST['subject'] ;
$message = $_POST['message'] ;
//validate contact fields
if (!strstr(trim($ _POST['email']),"@"))
{
$email_error = "<p class='comment' >please enter your email
address!</p><br>";
$contact = "no";
}
if ($_POST['name'] == "")
{
$name_error = "<p class='comment' >name field is blank!</p><br>";
$contact = "no";
}
if ($_POST['email'] == "")
{
$email_error = "<p class='comment' >email field is blank!</p><br>";
$contact = "no";
}
if ($_POST['subject'] == "")
{
$subject_error = "<p class='comment' >subject field is
blank!</p><br>";
$contact = "no";
}
if ($_POST['message'] == "")
{
$message_error = "<p class='comment' >message field is
blank</p><br>";
$contact = "no";
}
if ($contact != "no")
{
//if pass, then submit email and redirect to thankyou page
mail($to, $subject, $message, "From: $name <$email>");
{
header("Locatio n: contactsent.htm l");
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<link href="css/jace2.css" rel="stylesheet " type="text/css" />
</head>
<body>
<p class="topic">U nable to send your message!</p><br>
<?PHP
//list error(s)
else if $send == "no");
{
echo "$name_erro r";
echo "$email_err or";
echo "$subject_error ";
echo "$message_error ";
}
?>
<p> Click your browser's "back" ; button to return to the
contact form and fill missing fields.<br>
</p>
</body>
</html>
Comment