I was trying to build a new website for myself, and I used an old php form to email section. Funny thing it was working fine on the old one, for some reason it is no longer functioning right: it displays the whole when testing in firefox.
When I uploaded it nontheless, it gave me the error:
Parse error: syntax error, unexpected T_VARIABLE in /hsphere/local/home/sampharo/emirates-enterprise.com/register.php on line 106
This corresponds to the line: $subject = '[Registration] : ' . $subject;
The following is the php part
<?php
$error = ''; // error message
$name = ''; // sender's name
$email = ''; // sender's email address
$course = ''; // chosen course
$subject = 'Course Registration Form'; // subject
$message = ''; // the message itself
$spamcheck = ''; // Spam check
if(isset($_POST['send']))
{
$name = $_POST['name'];
$email = $_POST['email'];
$course = $_POST['course'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$spamcheck = $_POST['spamcheck'];
if(trim($name) == '')
{
$error = '<div class="errormsg">Please enter your name!</div>';
}
else if(trim($email) == '')
{
$error = '<div class="errormsg">Please enter your email address!</div>';
}
else if(!isEmail($email))
{
$error = '<div class="errormsg">You have enter an invalid e-mail address. Please, try again!</div>';
}
if(trim($subject) == '')
{
$error = '<div class="errormsg">Please enter a subject!</div>';
}
else if(trim($message) == '')
{
$error = '<div class="errormsg">Please enter your message!</div>';
}
else if(trim($spamcheck) == '')
{
$error = '<div class="errormsg">Please enter the number for Spam Check!</div>';
}
else if(trim($spamcheck) != '5')
{
$error = '<div class="errormsg">Spam Check: The number you entered is not correct! 2 + 3 = ???</div>';
}
if($error == '')
{
if(get_magic_quotes_gpc())
{
$message = stripslashes($message);
}
// the email will be sent here
// make sure to change this to be your e-mail
$to = "example@example.com"; "example2@example2.com"
// the email subject
// '[Contact Form] :' will appear automatically in the subject.
// You can change it as you want
$subject = '[Registration] : ' . $subject;
// the mail message ( add any additional information if you want )
$msg = "From : $name \r\ne-Mail : $email \r\nSubject : $subject \r\n\n : $course \r\n\n". "Message : \r\n$message";
mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n");
// autoresponder subject
$subject2 = 'Course Registration Confirmation: Thank you for your registration';
// autoresponder message
$msg2 ="Dear $name \r\n\nThank you for registering to attend our $course course.\r\n\If you need any further assistance, please don't hesitate to contact us:\r\n\nEmirates Enterprise\r\n1622, One Sentral, Jln Sentral Stesen 5,\r\n KL Sentral, 50470, KL\r\n";
mail($email, $subject2, $msg2, "From: $to\r\nReply-To: $to\r\nReturn-Path: $to\r\n");
?>
Can someone help me with detecting what the problem is? Is some line used in this php script outdated or something?