Parse error: syntax error, unexpected $end in /home/sloki/user/masterli/sites/masterlink.co.id/www/kontak_action.php on line 88
kontak-action.php
<?php
echo 'step X';
$nama = check_input($_POST['nama'], "Enter your name");
$email = check_input($_POST['email'], "Enter your email");
$telp = check_input($_POST['telp'], "Enter your phone number");
$questions = check_input($_POST['questions'], "Write your comments");
?>
Your name is: <?php echo $nama; ?><br />
Your e-mail: <?php echo $email; ?><br />
Your phone: <?php echo $telp; ?><br />
Your comments: <?php echo $questions; ?><br />
<br />
<?php
/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("E-mail address not valid");
}
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
die($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
<?php /* end */ ?>
<?php
$name = $_REQUEST['nama'];
$email = $_REQUEST['email'];
$telp = $_REQUEST['telp'];
$question = $_REQUEST['question'];
function HtmlSecure() {
$_GET = array_map('htmlspecialchars' , $_GET);
$_POST = array_map('htmlspecialchars' , $_POST);
$_COOKIE = array_map('htmlspecialchars' , $_COOKIE);
}
HtmlSecure();
$to = "davy_yg@yahoo.com";
$subject = "Masterlink.co.id Contacts";
$from = "info@masterlink.co.id";
$body = "A visitor at masterlink.co.id has sent the following information\n
Nama : $name
Email : $email
Telp : $telp
Pesan : $question";
if (mail($to, $subject, $body,"From: info@masterlink.co.id"))
{
// header("location:../index.php?pg=Contacts&lang=$lang");
echo "We've received your contact information";
}
else
{
//header("location:../index.php?pg=Contacts&lang=$lang");
echo "ERROR";
}
?>
Line 88 is the last line. What else do I need to fix? I basically need to validate the form for required field besides the captcha.
Thanks.