hi - it's my first day attempting php and my second page.. the first one went ok so I copied it for the second and amended accordingly however I'm getting a parse error and can't find the problem - can anyone help?!

Parse error: parse error, unexpected T_STRING in /data/quint/html/q_wine_site/qw_join.php on line 17

Below is the first part of the code for comparison with lines before and after - the....
$Post Code = Trim(stripslashes($_POST));
.....is the mysterious line 17...

<?php

// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST));
$EmailTo = "sally@quintessentially.com";
$Subject = "Quintessentially Wines New Registration Form";
$Title = Trim(stripslashes($_POST));
$FirstName = Trim(stripslashes($_POST));
$Initials = Trim(stripslashes($_POST));
$Surname = Trim(stripslashes($_POST));
$DOB = Trim(stripslashes($_POST));
$Gender = Trim(stripslashes($_POST));
$Address1 = Trim(stripslashes($_POST));
$Address2 = Trim(stripslashes($_POST));
$City = Trim(stripslashes($_POST));
$County = Trim(stripslashes($_POST));
$Post Code = Trim(stripslashes($_POST));
$Country = Trim(stripslashes($_POST));
$Email Address = Trim(stripslashes($_POST));
$Home Tel. = Trim(stripslashes($_POST));
$Mobile. = Trim(stripslashes($_POST));
$Work Tel. = Trim(stripslashes($_POST));
$Company = Trim(stripslashes($_POST));
$Job Title = Trim(stripslashes($_POST));
$Submit Date = Trim(stripslashes($_POST));
$Proposed by = Trim(stripslashes($_POST));
$Heard about Q = Trim(stripslashes($_POST));
$TCcheck = Trim(stripslashes($_POST));


// validation
$validationOK=true;
if (Trim($FirstName)=="") $validationOK=false;
if (Trim($Surname)=="") $validationOK=false;
if (Trim($Title)=="") $validationOK=false;
if (Trim($DOB)=="") $validationOK=false;
if (Trim($Address1)=="") $validationOK=false;
if (Trim($City)=="") $validationOK=false;
if (Trim($Post Code)=="") $validationOK=false;
if (Trim($Country)=="") $validationOK=false;


any advice for a newbie much appreciated"

Recommended Answers

All 2 Replies

i think you cannot have spaces in variable names. ex. $Post Code try $Post_Code

thanks very much - will try that when back at my desk on monday! I presume if I just fixed that one line it would come up with the next and doesn't point out all the line errors at once? (i've not had a parse error before hence why I'm unfamiliar with how the errors appear!)that would make sense as it's the first time the space occurs...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.