• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

online submission problems... its erroraneous!

Riverworld

New Member
I'm just trying to get an online enrolment form happening for Bankstown Community College, but I keep running into an error here and there.

The form is at www.bankstowncommunitycollege.nsw.edu.au/new/?body=enrolment&area=online

the php script is located at www.bankstowncommunitycollege.nsw.edu.au/enrol.php and this is the code for the script:

Code:
<?

// Change [email]you@your.com[/email] to the email address you want to receive these at.
$admin = ("<snip>");

// Change YourSite.Com to your site's name. Can be Your Site or YourSite.com or whatever.
$sitename = ("BankstownCommunityCollege.nsw.edu.au");

// These are your form's fields. 
$coursecode1 = $_POST['coursecode1'];
$day1 = $_POST['day1'];
$coursename1 = $_POST['coursename1'];
$fee1 = $_POST['fee1'];
$coursecode2 = $_POST['coursecode2'];
$day2 = $_POST['day2'];
$coursename2 = $_POST['coursename2'];
$fee2 = $_POST['fee2'];
$coursecode3 = $_POST['coursecode3'];
$day3 = $_POST['day3'];
$coursename3 = $_POST['coursename3'];
$fee3 = $_POST['fee3'];
$collegemember = $_POST['collegemember'];
$discount = $_POST['discount'];
$totalfees = $_POST['totalfees'];
$term = $_POST['term'];
$year = $_POST['year'];
$previousstudent = $_POST['previousstudent'];
$firstname = $_POST['firstname'];
$familyname = $_POST['familyname'];
$address = $_POST['address'];
$suburb = $_POST['suburb'];
$postcode = $_POST['postcode'];
$homearea = $_POST['homearea'];
$homenumber = $_POST['homenumber'];
$workarea = $_POST['workarea'];
$worknumber = $_POST['worknumber'];
$mobile = $_POST['mobile'];
$namewas = $_POST['namewas'];
$addresswas = $_POST['addresswas'];
$pensioncard = $_POST['pensioncard'];
$seniorcard = $_POST['seniorcard'];
$dobday = $_POST['dobday'];
$dobmonth = $_POST['dobmonth'];
$dobyear = $_POST['dobyear'];
$sex = $_POST['sex'];
$Email = $_POST['email'];
$residenttype = $_POST['residenttype'];
$lote = $_POST['lote'];
$countrybornau = $_POST['countrybornau'];
$howspeakenglish = $_POST['howspeakenglish'];
$disability = $_POST['disability'];
$aboriginal = $_POST['aboriginal'];
$hearing = $_POST['hearing'];
$intellectual = $_POST['intellectual'];
$mental = $_POST['mental'];
$vision = $_POST['vision'];
$medical = $_POST['medical'];
$physical = $_POST['physical'];
$learning = $_POST['learning'];
$brain = $_POST['brain'];
$impairment = $_POST['impairment'];
$other = $_POST['other'];
$highschool = $_POST['highschool'];
$yearhighschoolcompleted = $_POST['yearhighschoolcompleted'];
$attendinghighschool = $_POST['attendinghighschool'];
$bachelor = $_POST['bachelor'];
$advanceddiploma = $_POST['advanceddiploma'];
$diploma = $_POST['diploma'];
$civ = $_POST['civ'];
$ciii = $_POST['ciii'];
$cii = $_POST['cii'];
$ci = $_POST['ci'];
$c = $_POST['c'];
$jobstatus = $_POST['jobstatus'];
$coe = $_POST['coe'];
$ipaddress = GetHostByName($REMOTE_ADDR);

$submissiondate = date("D dS M, Y h:i a");

$filename= "content/contact/counter.txt" ; // Numbers the submissions of the form
$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
$fstring = fread ($fd , filesize ($filename)) ;
fclose($fd) ;

$fd = fopen ($filename , "w") or die ("Can't open $filename") ;
$fcounted = $fstring + 1 ;
$fout = fwrite ($fd , $fcounted ) ;
fclose($fd) ;

// This is your formatted message.

$msg = "----- Online Enrolment from BankstownCommunityCollege.nsw.edu.au -----\n\n";
$msg .= "Date/Time Submitted:     $submissiondate - EST\n";
$msg .= "Submission ID:           $fcounted\n\n";
$msg .= "Enroler's IP address:    $ipaddress\n";
$msg .= "Name:                    $firstname $familyname\n";
$msg .= "Mailing Address:         $address\n";
$msg .= "                         $suburb, postcode\n\n";
$msg .= "Email                    $Email\n";
$msg .= "Home Phone:              ($homearea) $homenumber\n";
$msg .= "Work Phone:              ($workarea) $worknumber\n";
$msg .= "                                     ";
$msg .= "If they have changed their name since last time:";
$msg .= "Name Was:                $namewas\n\n";
$msg .= "Address Was:             $addresswas\n";
$msg .= "";
$msg .= "Date of Birth:           $dobday/$dobmonth/$dobyear\n\n";
$msg .= "Sex:                     $sex\n";
$msg .= "Course they wish to enrol in:"
$msg .= "Course Code:             $coursecode1\n\n";
$msg .= "Day:                     $day1\n";
$msg .= "Course Name:             $coursename1\n\n";
$msg .= "Fee:                     $fee1\n";
$msg .= "Course Code:             $coursecode2\n\n";
$msg .= "Day:                     $day2\n";
$msg .= "Course Name:             $coursename2\n\n";
$msg .= "Fee:                     $fee2\n";
$msg .= "Course Code:             $coursecode3\n\n";
$msg .= "Day:                     $day3\n";
$msg .= "Course Name:             $coursename3\n\n";
$msg .= "Fee:                     $fee3\n";
$msg .= "Become a College Member: $collegemember\n\n";
$msg .= ""
$msg .= "Discount:                $discount\n";
$msg .= "Total fees:              $totalfees\n\n";
$msg .= ""
$msg .= "Pension/Health Care Card No: $pensioncard\n";
$msg .= "Senior/Student Card No:  $seniorcard\n";
$msg .= "Term:                    $term\n";
$msg .= "Year:                    $year\n";
$msg .= "Previous Student         $previousstudent\n";
$msg .= ""
$msg .= "Questionaire:"
$msg .= "Country Born:            
$msg .= "            Australia?   $countrybornau\n";
$msg .= "                Other:   $othercountryborn\n";
$msg .= "     Type of Resident:   $residenttype\n";
$msg .= "Speak LOTE at home:      $lote\n";
$msg .= "If above was yes, how well speak English     $howspeakenglish
$msg .= "Origin:                  $aboriginal\n";
$msg .= "Disability, impairment or long-term condition: $disability\n";
$msg .= "If yes to above, one of the following should show up:"
$msg .= "                         $hearing\n";
$msg .= "                         $hearing\n";
$msg .= "                         $intellectual\n";
$msg .= "                         $mental\n";
$msg .= "                         $vision\n";
$msg .= "                         $medical\n";
$msg .= "                         $physical\n";
$msg .= "                         $learning\n";
$msg .= "                         $brain\n";
$msg .= "                         $impairment\n";
$msg .= "                         $other\n";
$msg .= "Highest completed school level: $highschool\n";
$msg .= "Year completed that year:  $yearhighschoolcompleted\n";
$msg .= "Still attending highschool:  $attendinghighschool\n";
$msg .= "Qualification completed:"
$msg .= "                   $bachelor\n";
$msg .= "                   $advanceddiploma\n";
$msg .= "                   $diploma\n";
$msg .= "                   $civ\n";
$msg .= "                   $ciii\n";
$msg .= "                   $cii\n";
$msg .= "                   $ci\n";
$msg .= "                   $c\n";
$msg .= "Employment status:   $jobstatus\n";
$msg .= ""
$msg .= "Do they agree to Conditions of Enrolment:  $coe\n";


$to = "$admin";
$subject = "Online Enrolment Submission No. $fcounted\n";
$mailheaders = "From: $FName $LName <$Email>\n";
$mailheaders .= "Reply-To: $FName $LName <$Email>\n";

mail($to, $subject, $msg, $mailheaders);

?>

You can fool around with it on the server (like submit the form), anything that does get through will only go to my personal email until I know its working, then I'll change it to email the College.

Code:
Parse error: parse error in /usr/home/bankcoll/www.bankstowncommunitycollege.nsw.edu.au/html/new/enrol.php on line 110

That's the error I'm getting so far, but I have a slight feeling it wont be the only one :?

Just for ease of use, line 110 is:

Code:
$msg .= "Course Code:             $coursecode1\n\n";

Any help in debugging it would be extremely appreciated.

Thanks all who even got down this far ;)

River
 
your error is at line 109. (you forget to append semicolon)

my opinion about the script: wasteful and inefficient. that script will use memory for something useless. (it'd been better not creating another variable for each super-array variable (variable taken from POST or GET).
 
Back
Top