Hi all,
I have been attempting to make a contact form through use of CSS and php. I have placed the necessary files in the web server, but I am getting an error message, which reads:
Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\contact.php on line 10
The code for the whole page is:
I have actually been following a tutorial and I have carefully checked the code compared to what they published and it all seems to be ok from a copying front. I am using the latest version of XAMPP, which should be fine with the code I think. Any help greatly appreciated.
Cheers
Ross
I have been attempting to make a contact form through use of CSS and php. I have placed the necessary files in the web server, but I am getting an error message, which reads:
Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\contact.php on line 10
The code for the whole page is:
Code:
<?php
if (isset($_POST['Submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$mailing = $_POST['mailing'];
if($name == '' or $email == '' or $comments == '') {
$err = true;
$msg = 'Please complete your name, email address and comments to submit the form.';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Liquid Crystal Art Contact Page</title>
<link href="contact.css" rel="stylesheet" title="Contact" type="text/css" />
</head>
<body>
<?php
if($err == true) {
echo '<p class="error">'. $msg . '</p>';
}
?>
<form id="form1" name="form1" method="post" action="">
<div>
<label for="name">Name</label>
<input name="name" type="text" class="text" id="name" />
<div>
<label for="email">Email Address</label>
<input name="email" type="text" class="text" id="email" />
</div>
<div>
<label for="comments">Comments</label>
<textarea name="comments" cols="30" rows="6" class="text" id="comments"></textarea>
<div>
<label for="mailing">Add me to your mailing list</label>
<input type="checkbox" name="mailing" value="true" id="mailing" />
<div>
<input name="Submit" type="submit" class="btn" value="Submit" />
</div>
</div>
</div>
</div>
</form>
</body>
</html>
I have actually been following a tutorial and I have carefully checked the code compared to what they published and it all seems to be ok from a copying front. I am using the latest version of XAMPP, which should be fine with the code I think. Any help greatly appreciated.
Cheers
Ross