Hi Everyone,
I update and maintain the website for my university's fitness division and am running into problems with trying to make a simple contact form. It will give this error:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /usr/local/apache/ysuweb/reccenter/wellness/contact.php on line 22
and I have no idea how I can get this thing working... I've been working on it all afternoon but my PHP skills are not what they should be :o . Hopefully it's something small I am glancing over and any help would be greatly appreicated!
http://www.ysu.edu/reccenter/wellness/formtest.html here is the form
and http://www.ysu.edu/reccenter/wellness/contact.php this is the PHP.
<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "example@example.com";
$Subject = "Web Form";
$TeamClimb = Trim(stripslashes($_POST['TeamClimb']));
$TeamChallengeProgram = Trim(stripslashes($_POST['TeamChallengeProgram']));
$ElevatedTeamChallengeProgram = Trim(stripslashes($_POST['ElevatedTeamChallengeProgram']));
$TeamClimbChallengeCombo = Trim(stripslashes($_POST['TeamClimbChallengeCombo']));
$ElevatedTeamClimbChallengeCombo = Trim(stripslashes($_POST['ElevatedTeamClimbChallengeCombo']));
$TeamChallengeCombo = Trim(stripslashes($_POST['TeamChallengeCombo']));
$CustomChallengeProgram = Trim(stripslashes($_POST['CustomChallengeProgram']));
$GroupName = Trim(stripslashes($_POST['GroupName']));
$GroupContact = Trim(stripslashes($_POST['GroupContact']));
$PhoneNumber = Trim(stripslashes($_POST['PhoneNumber']));
$GroupAgeRange = Trim(stripslashes($_POST['GroupAgeRange']));
$1stDateTime = Trim(stripslashes($_POST['1stDateTime']));
$1stDatePreference = Trim(stripslashes($_POST['1stDatePreference']));
$2ndDateTime = Trim(stripslashes($_POST['2ndDateTime']));
$2ndDatePreference = Trim(stripslashes($_POST['2ndDatePreference']));
$GroupWorkingTogetherFor = Trim(stripslashes($_POST['GroupWorkingTogetherFor']));
$PastExperience = Trim(stripslashes($_POST['PastExperience']));
$Forming = Trim(stripslashes($_POST['Forming']));
$Storming = Trim(stripslashes($_POST['Storming']));
$Norming = Trim(stripslashes($_POST['Norming']));
$Performing = Trim(stripslashes($_POST['Performing']));
$Goals = Trim(stripslashes($_POST['Goals']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "TeamClimb: ";
$Body .= $TeamClimb;
$Body .= "\n";
$Body .= "TeamChallengeProgram: ";
$Body .= $TeamChallengeProgram;
$Body .= "\n";
$Body .= "ElevatedTeamChallengeProgram: ";
$Body .= $ElevatedTeamChallengeProgram;
$Body .= "\n";
$Body .= "TeamClimbChallengeCombo: ";
$Body .= $TeamClimbChallengeCombo;
$Body .= "\n";
$Body .= "ElevatedTeamClimbChallengeCombo: ";
$Body .= $ElevatedTeamClimbChallengeCombo;
$Body .= "\n";
$Body .= "TeamChallengeCombo: ";
$Body .= $TeamChallengeCombo;
$Body .= "\n";
$Body .= "CustomChallengeProgram: ";
$Body .= $CustomChallengeProgram;
$Body .= "\n";
$Body .= "GroupName: ";
$Body .= $GroupName;
$Body .= "\n";
$Body .= "GroupContact: ";
$Body .= $GroupContact;
$Body .= "\n";
$Body .= "PhoneNumber: ";
$Body .= $PhoneNumber;
$Body .= "\n";
$Body .= "GroupAgeRange: ";
$Body .= $GroupAgeRange;
$Body .= "\n";
$Body .= "1stDateTime: ";
$Body .= $1stDateTime;
$Body .= "\n";
$Body .= "1stDatePreference: ";
$Body .= $1stDatePreference;
$Body .= "\n";
$Body .= "2ndDateTime: ";
$Body .= $2ndDateTime;
$Body .= "\n";
$Body .= "2ndDatePreference: ";
$Body .= $2ndDatePreference;
$Body .= "\n";
$Body .= "GroupWorkingTogetherFor: ";
$Body .= $GroupWorkingTogetherFor;
$Body .= "\n";
$Body .= "PastExperience: ";
$Body .= $PastExperience;
$Body .= "\n";
$Body .= "Forming: ";
$Body .= $Forming;
$Body .= "\n";
$Body .= "Storming: ";
$Body .= $Storming;
$Body .= "\n";
$Body .= "Norming: ";
$Body .= $Norming;
$Body .= "\n";
$Body .= "Performing: ";
$Body .= $Performing;
$Body .= "\n";
$Body .= "Goals: ";
$Body .= $Goals;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>