Benjee Posted July 3, 2007 Share Posted July 3, 2007 Hey all, Firstly can I say sorry if what I'm asking makes no sense whatsoever... I'm really not the best with code I've made what I thought would be a simple contact/information submission form, based on code that I'd found on the web. When submit the form I get a white page appear with the following message on: Parse error: parse error, unexpected '=' in \\nas38ent\domains\j\jamjee.co.uk\user\htdocs\4weddings\contact.php on line 12 Your help would be greatly appreciated, thanks in advance Ben The following code from contact.php: <?php // get posted data into local variables $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "[email protected]"; $Subject = "FW&AP Contact Form"; $Name = Trim(stripslashes($_POST['Name'])); $Tel = Trim(stripslashes($_POST['Tel'])); $Email = Trim(stripslashes($_POST['Email'])); $Bridals = Trim(stripslashes($_POST['Bridals'])); $Formals = Trim(stripslashes($_POST['Formals'])); $FacePainting = Trim(stripslashes($_POST['FacePainting'])); $Make-up-Evenings = Trim(stripslashes($_POST['Make-up-Evenings'])); $EventDate = Trim(stripslashes($_POST['EventDate'])); $Suburb = Trim(stripslashes($_POST['Suburb'])); $Time = Trim(stripslashes($_POST['Time'])); $NoReqMake-up = Trim(stripslashes($_POST['NoReqMake-up'])); $Message = Trim(stripslashes($_POST['Message'])); // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Tel: "; $Body .= $Tel; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Bridals: "; $Body .= $Bridals; $Body .= "\n"; $Body .= "Formals: "; $Body .= $Formals; $Body .= "\n"; $Body .= "FacePainting: "; $Body .= $FacePainting; $Body .= "\n"; $Body .= "Make-up-Evenings: "; $Body .= $Make-up-Evenings; $Body .= "\n"; $Body .= "EventDate: "; $Body .= $EventDate; $Body .= "\n"; $Body .= "Suburb: "; $Body .= $Suburb; $Body .= "\n"; $Body .= "Time: "; $Body .= $Time; $Body .= "\n"; $Body .= "NoReqMake-up: "; $Body .= $NoReqMake-up; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $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.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; } ?> Link to comment https://forums.phpfreaks.com/topic/58307-solved-whats-this-parse-error-parse-error-unexpected-in/ Share on other sites More sharing options...
sasa Posted July 3, 2007 Share Posted July 3, 2007 - is not regular character for variable name Link to comment https://forums.phpfreaks.com/topic/58307-solved-whats-this-parse-error-parse-error-unexpected-in/#findComment-289094 Share on other sites More sharing options...
Benjee Posted July 3, 2007 Author Share Posted July 3, 2007 Right, so if I try renaming the fields which use "-" maybe it should work then? I'll have a go. Thanks Link to comment https://forums.phpfreaks.com/topic/58307-solved-whats-this-parse-error-parse-error-unexpected-in/#findComment-289096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.