Question : Help PHP

Just learning PHP, getting this error, not sure how to resolve:

Parse error: syntax error, unexpected T_VARIABLE in C:\Inetpub\vhosts\harrisburgu.net\httpdocs\mailer.php on line 35
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
<?php
if(isset($_POST['Requestor'])) {
	
	// EDIT THE 2 LINES BELOW AS REQUIRED
	$email_to = "[email protected]";
	$email_subject = "MediaSite Request";
	$email_from = "[email protected]";
	$error = "Something went wrong, contact Help Desk at 5177";
	
	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['Class_Name']) ||
		!isset($_POST['Requestor']) ||
		!isset($_POST['Presenter']) ||
		!isset($_POST['Recording_Title']) ||
		!isset($_POST['Date_Start']) ||
		!isset($_POST['Date_End']) ||
		!isset($_POST['Start_Time']) ||
		!isset($_POST['End_Time']) ||
		isset($_POST['Room_Number']) ||
		isset($_POST['Internal_external_presentation']) ||
		isset($_POST['Student_Presentation']) ||
		died('We are sorry, but there appears to be a problem with the form your submitted.')		
	


	$Class_Name = $_POST['Class_Name']; // required
	$Requestor = $_POST['first_name']; // required
	$Presenter = $_POST['Presenter']; // required
	$Recording_Title = $_POST['Recording_Title']; // required
	$Date_Start = $_POST['Date_Start']; // not required
	$Date_End = $_POST['Date_End']; // required
	$Start_Time = $_POST['Start_Time']; // required	
	$End_Time = $_POST['End_Time']; // required
	$Room_Number = $_POST['Room_Number']; // required
	$Internal_external_presentation = $_POST['Internal_external_presentation']; // required
	$Student_Presentation = $_POST['Student_Presentation']; // required
	$Special_Request = $_POST['Special_Request']
	
  
	$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 .= "Class_Name: ".clean_string($Class_Name)."\n";
	$email_message .= "Requestor: ".clean_string($Requestor)."\n";
	$email_message .= "Presenter: ".clean_string($Presenter)."\n";
	$email_message .= "Recording_Title: ".clean_string($Recording_Title)."\n";
	$email_message .= "Date_Start: ".clean_string($Date_Start)."\n";
	$email_message .= "Date_End: ".clean_string($Date_End)."\n";
	$email_message .= "Start_Time: ".clean_string($Start_Time)."\n";
	$email_message .= "End_Time: ".clean_string($End_Time)."\n";
	$email_message .= "Room_Number: ".clean_string($Room_Number)."\n";
	$email_message .= "Internal_external_presentation: ".clean_string($Internal_external_presentation)."\n";
	$email_message .= "Student_Presentation: ".clean_string($Student_Presentation)."\n";
	$email_message .= "Special_Request: ".clean_string($Special_Request)."\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 -->

Thank you for contacting the Harrisburg University Help Desk. We will be in touch with you very soon.

<?
}
?>

Answer : Help PHP

>>Parse error: syntax error, on line 50
It typically does NOT mean EXACTLY on line X, but "NEAR" line X. In this case the problem is on line 47.

>>$Special_Request = $_POST['Special_Request']
It is missing a semicolon at the end
$Special_Request = $_POST['Special_Request'];
Random Solutions  
 
programming4us programming4us