Parse error: syntax error, unexpected T_STRING in /srv/disk2/651048/www/form.125mb.com/process.php on line 56
Please help me find the error so that code works. url (www.form.125mb.com)
<?php
// Configuration - Your Options
$allowed_filetypes = array('.jpg','.gif','.bmp','.png', '.doc', '.docx', '.txt', '.pdf'); // These will be the types of file that will pass the validation.
$max_filesize = 2097152; // Maximum filesize in BYTES (currently 2.0MB).
$upload_path = './files/'; // The place the files will be uploaded to (currently a 'files' directory).
$filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.
// Check if the filetype is allowed, if not DIE and inform the user.
if(!in_array($ext,$allowed_filetypes))
die('הקובץ שניסית להעלות אינו מותר.');
// Now check the filesize, if it is too large then DIE and inform the user.
if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
die('הקובץ שניסית להעלות גדול מדי.');
// Check if we can upload to the specified path, if not DIE and inform
the user.
if(!is_writable($upload_path))
die('אתה לא יכול להעלות לספרייה שצוינה, אנא פנה לתמיכה.');
// Upload the file to your specified path.
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path .
$filename))
echo ' העלאת הקובץ שלך הסתיימה בהצלחה, לצפיית הקובץ <a href="' .
$upload_path . $filename . '" title="הקובץ שלך">פה</a>'; //
else
echo 'אירעה שגיאה בעת העלאת הקובץ. אנא נסה שוב.'; // (.
$errors = '';
$myemail = 'air133@idf.gov.il';//<-----שים את כתובת הדוא"ל שלך כאן.
if(empty($_POST['fname']) ||
empty($_POST['lname']) ||
empty($_POST['idname']) ||
empty($_POST['telephone']) ||
empty($_POST['email']) ||
empty($_POST['opt1']) ||
empty($_POST['opt2']) ||
empty($_POST['message']))
{
$errors .= "\n שגיאה: כל השדות הם שדות חובה";
}
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$lname = $_POST['idname'];
$lname = $_POST['telephone'];
$email_address = $_POST['email'];
$lname = $_POST['opt1'];
$lname = $_POST['opt2'];
$message = $_POST['message'];
if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
$email_address))
{
$errors .= "\n שגיאה: כתובת דוא"ל לא חוקית";
}
if( empty($errors))
{
$to = $myemail;
$email_subject = "$opt1 $lname $idname";
$email_body = "בקשה חדשה".
"פרטים \n שם פרטי: $fname \n שם משפחה: $lname \n מס' זהות:
$idname \n טלפון: $telephone \n דוא''ל: $email_address \n
\n שלב מייון: $opt2 \n \n בקשה \n $message \n \n קובץ מצורף יכול להיות
נוכח".
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
header('Location: ty.html');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>בקשה אל חיל-האוויר</title>
</head>
<body>
<!-- דף זה מוצג רק אם ישנה שגיאה -->
<?php
echo nl2br($errors);
?>
</body>
</html>