First issue relates to a new script that validates user input and based on a variable passed with the form action performs actions based on if statements.
I formulated an input that I knew would pass a certain variable to the page. Tested the variable on the page to ensure the correct variable existed.
There are three if statements on the page to perform an action. The first problem was an error generated from a line in another if that did not meet the test criteria.
if ($mode=='free')
this is the code that meets the test condition
if ($mode=='upgrd')
this is the section the error occurs in
if ($mode=='full')
this code does not meet the coondition and when the above if (free) is commented out the script runs perfect
The first question:
Why did I get an error on an update statement when the if statement being executed would not meet the criteria?
the error:
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /var/www/html/dunhill/register-action.php on line 223
note that line 223 is not within the section of code the if statement comprises.
here is the line:
$result=dbquery("UPDATE users SET address='$address', address1='$address1', city='$city', state='$state', zip='$zip', country='$country', refercode='$refercode', birthdate='$birthdate', sex='$sex', membertype='$membertype' WHERE userid='$_SESSION['userid']'");
the dbquery function is a tested function that works in all other instances. In fact I can comment out the entire if statement this line exists in and the script runs perfect!