Hallo
Could some tell me why am getting the following error message.
Parse error: syntax error, unexpected '{' in C:\wamp\www\financialacadem\thank_you.php on line 23
Here are the codes for both the contact.php and the thank_you.php
<form id="contact" action="thank_you.php" method="post">
<div class="form-row">
<label for="first_name">First Name</label>:
<input name="first_name" id="first_name" class="required" size="30" maxlength="50" title="Please enter your first name." value="">
</div>
<div class="form-row">
<label for="last_name">Last Name</label>:
<input name="last_name" id="last_name" class="required" size="30" maxlength="50" title="Please enter your last name." value="">
</div>
<div class="form-row">
<label for="email">Email</label>:
<input name="email" id="email" class="required validate-email" size="30" maxlength="50" title="Please enter your email address." value="">
</div>
<div class="form-row">
<label for="phone">Telephone</label>:
<input name="telephone" id="telephone" class="required"size="15" maxlength="30" title="Please enter your phone number." value="">
<div style="visibility: visible; opacity: 1;" id="country_phone_tip" class="">
<img src="images/small_right_arrow.png" alt="arrow" align="absmiddle" height="9" width="8">
<img id="country_flag" src="images/ke.png" alt="flag" align="absmiddle" height="11" width="16">
<em>
<span class="country_code"><abbr>254</abbr> </span>
<span class="area_code">(<abbr>xx</abbr>) </span>
<span class="number_mask"><abbr>xxx-xxx</abbr></span>
</em>
</div>
</div>
<div class="form-row">
<label for="time">Best Call Time</label>:<br>
<select name="time" id="time">
<option value="any" selected="selected">Any
</option><option value="1:00">1:00</option>
<option value="1:30">1:30</option>
<option value="2:00">2:00</option>
<option value="2:30">2:30</option>
<option value="3:00">3:00</option>
<option value="3:30">3:30</option>
<option value="4:00">4:00</option>
<option value="4:30">4:30</option>
<option value="5:00">5:00</option>
<option value="5:30">5:30</option>
<option value="6:00">6:00</option>
<option value="6:30">6:30</option>
<option value="7:00">7:00</option>
<option value="7:30">7:30</option>
<option value="8:00">8:00</option>
<option value="8:30">8:30</option>
<option value="9:00">9:00</option>
<option value="9:30">9:30</option>
<option value="10:00">10:00</option>
<option value="10:30">10:30</option>
<option value="11:00">11:00</option>
<option value="11:30">11:30</option>
<option value="12:00">12:00</option>
<option value="12:30">12:30</option>
</select>
<select name="tt">
<option value="am" selected="selected">AM</option>
<option value="pm">PM</option>
</select>
</div>
<div class="form-row-submit">
<!--<input type="submit" name="submit_btn" value="Tell Me More!" class="button" title="Continue" />-->
<input src="images/submit.png" name="submit_btn" value="Tell Me More!" class="submit" title="Continue" type="image">
</div>
<input name="formid" value="contact" type="hidden"></form>
Thank_you.php
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "matotien@gmail.com";
$email_subject = "Request for Free Introduction";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form your submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset ($_POST['time']) || {
died('We are sorry, but there appears to be a problem with the form your submitted.');
}
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; //required
$time = $_POST['time'];//required
$error_message = "";
$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
if(!eregi($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "^[a-z .'-]+$";
if(!eregi($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!eregi($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
$string_exp = "^[0-9 .-]+$";
if(!eregi($string_exp,$telephone)) {
$error_message .= 'The Telphone Number you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Best call Time: ".clean_string($time)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
<!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">
<!-- @(#) $Id$ -->
<head>
<title>Financial Academy & Technology</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content= ""/>
<meta name="Description" content="" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<link rel="shortcut icon" href="images/financial-logo.jpg" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/customize.css" />
<link rel="stylesheet" type="text/css" href="css/layout.css" />
</head>
<body>
<div id="wrap">
<?php
include("logo.php");
?>
<div id="breadcrumb">
<ul>
<li><a href="index.php" class="">Home</a></li>
<li><a href="corporate.php" class="">Corporate Training</a></li>
<li><a href="private.php" class="">Personal Financial Coaching</a></li>
<li><a href="about.php" class="">About Us</a></li>
<li><a href="contacts.php" class="active">Contact Us</a></li>
</ul>
</div>
<div id="main-body">
<div id="content">
<div class="inside">
<h1>Thank you for your interest in Financial Literacy Education</h1>
<h3>Your information has been submitted successfully</h3>
<p>Congratulatiom on taking an important step towards your success</p>
<h3>A representative will contact you shortly</h3>
<p>Would you like to tell a friend about Financial Literacy Education</p>
</div>
</div>
<div id="sidebar">
<div class="inside">
</div>
</div>
</div> <!--end of main-body-->
<div id="sidebar-2">
<div class="inside">
</div>
</div>
<?php
include("./include/footer.php");
?>
</div> <!--end of wrap-->
</body> </html>
<?
}
?>