Jump to content

"Parse error: parse error, unexpected T_STRING" error message


hadoob024

Recommended Posts

I have now been looking at this for about 2 hours and cannot for the life of me see where this error is coming from.  I thought it usually means that I have a '(' or '[' out of place, but still can't seem to find it.  Anyway, the error message is:

"Parse error: parse error, unexpected T_STRING in /blah.php on line 204"


And here's the code:
[CODE]
if (isset($_POST['expyear']))
{
if ((strlen($_POST['expyear']) == 4) && (is_numeric($_POST['expyear'])))
$expyear = $_POST['expyear'];
else
{
$problem = 7;
$problemtext .= '<B>You did not enter a valid credit card expiration year.</B><P>';
}
}
else
{
$problem = 7;
$problemtext .= '<B>You did not enter a valid credit card expiration year.</B><P>';
}

if (isset($_POST['cvm']))
{
if (strlen($_POST['cvm']) == 0)
$cvm = '';
elseif (((strlen($_POST['cvm']) == 3) || (strlen($_POST['cvm']) == 4)) && (is_numeric($_POST['cvm'])))
$cvm = $_POST['cvm'];
else
{
$problem = 7;
$problemtext .= '<B>You did not enter a valid CVM number.</B><P>';
}
}
else
{
$cvm = '';
}

if (isset($_POST['cvmnotpres']))
{
if ($_POST['cvmnotpres'] == 'on')
$cvmnotpres = $_POST['cvmnotpres'];
else
{
$problem = 7;
$problemtext .= '<B>You did not enter a valid value for the "Code not present" checkbox.</B><P>';
}
}

if (isset($_POST['bname']))
{
if (strlen($_POST['bname']) <= 60)
$bname = $_POST['bname'];
else
{
$problem = 7;
$problemtext .= '<B>Billing name is too long or wasn't entered.</B><P>';
}
}
else
{
$problem = 7;
$problemtext .= '<B>Billing name is too long or wasn't entered.</B><P>';
}
[/CODE]

Anyway, the error line comes to this line "$problem = 7;" in the "if (isset($_POST['bname']))" section.  I included the lines before it to because I know the line numbers usually don't line up properly with this kind of error.  Anyone see anything?  I've already gone cross-eyed and need to take a break.  Thanks!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.