Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]
Send this topic | Print
Topic: Parse error: syntax error, unexpected '{'  (Read 1221 times)
« on: February 17, 2008, 10:29:17 PM »
joshr35 Offline
Newbie

View Profile
*
Posts: 32



I can't seem to figure out how to fix this.

Here is the php file.

<?phpif ( (!strstr($_SERVER['PHP_SELF'],'login.php'))and(!strstr($_SERVER['PHP_SELF'],'create_account.php'))and!tep_session_is_registered('customer_id'))          {?><!-- loginbox //--><tr><td><center><TABLE WIDTH=175 BORDER=0 CELLPADDING=0 CELLSPACING=0>   <TR>      <TD COLSPAN=3><center>         <IMG SRC="images/boxes/table_signin.gif"></TD>   </TR>   <TR>   <td><?php    if (!tep_session_is_registered('customer_id')) {?>          <?php    $info_box_contents = array();    $info_box_contents[] = array('text'  => BOX_HEADING_LOGIN_BOX);       // new infoBoxHeading($info_box_contents, false, false);$loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'))                                                                  . BOX_LOGINBOX_EMAIL                                                                  . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"')                                                                 .'<br><br>'                                                                 . BOX_LOGINBOX_PASSWORD                                                                 . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"')                                                                 .'<a href="'                                                                 . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')                                                                 . '">'                                                                 . BOX_LOGINBOX_FORGOT_PASSWORD                                                                 . '</a>'                                                                 . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN)                                                                 . '</form><br><br>'                                                                 .  BOX_LOGINBOX_TEXT_NEW                                                                 . '<a href="'                                                                 . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')                                                                 . '">'                                                                 . BOX_LOGINBOX_NEW                                                                 . '</a>'                                                                 ; $info_box_contents = array();    $info_box_contents[] = array('align' => 'center',                                 'text'  => $loginboxcontent);    new infoBox($info_box_contents);?>          </TD>   </TR>   <TR>      <TD COLSPAN=3>         </TD>   </TR></TABLE></td></tr><?php  } else {  // If you want to display anything when the user IS logged in, put it  // in here...  Possibly a "You are logged in as :" box or something.  }?><!-- loginbox_eof //--><?php// WebMakers.com Added: My Account Info Box} else {  if (tep_session_is_registered('customer_id')) {?><!-- my_account_info //-->          <tr><td><center><TABLE WIDTH=175 BORDER=0 CELLPADDING=0 CELLSPACING=0>   <TR>      <TD COLSPAN=3><center>         <IMG SRC="images/boxes/table_myaccount.gif"></TD>   </TR>   <TR>   <td><?php  $info_box_contents = array();  $info_box_contents[] = array('align' => 'left',                               'text'  => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT); // new infoBoxHeading($info_box_contents, false, false);  $info_box_contents = array();  $info_box_contents[] = array('align' => 'left',                               'text'  =>                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>');  new infoBox($info_box_contents);?>           </TD>   </TR>   <TR>      <TD COLSPAN=3>         </TD>   </TR></TABLE></td></tr><!-- my_account_info_eof //--><?php  }}?>


Can anyone please help.

Thank you,

Josh R.
Report to moderator   Logged

 
« Reply #1 on: February 17, 2008, 11:08:03 PM »
T35 Head Forum Administrator
dWhite Offline
Administrator
Sr. Member

View Profile WWW
*****
Posts: 330



else {  if (tep_session_is_registered('customer_id')) {

should be

else {  if (tep_session_is_registered('customer_id')) }
Report to moderator   Logged

« Reply #2 on: February 17, 2008, 11:18:10 PM »
joshr35 Offline
Newbie

View Profile
*
Posts: 32



Ok, I changed that.  Now I'm getting this:

Parse error: syntax error, unexpected '}'
Report to moderator   Logged
« Reply #3 on: February 18, 2008, 03:20:25 PM »
chickenmeister Offline
master of chickens
Global Moderator
Member

View Profile WWW
*****
Posts: 220



have you ever heard of formatting? A simple format would make extra braces stick out like a sore thumb.

if (conditional statement )
{
      // indented block
}
Report to moderator   Logged

Hello world!
« Reply #4 on: February 18, 2008, 06:07:08 PM »
joshr35 Offline
Newbie

View Profile
*
Posts: 32



No, I have not heard of formatting, sorry.

Considering I know very little about PHP and the fact that this is an ecommerce script.  I counted 4 left and 4 right brackets.  PhpED claims there is no bracket problem at all.

With all said above, I am still at square one with the problem still existing in the script.
Report to moderator   Logged
« Reply #5 on: February 18, 2008, 08:07:40 PM »
chickenmeister Offline
master of chickens
Global Moderator
Member

View Profile WWW
*****
Posts: 220



I'm not 100% on this, but if the file is all on one line with no line breaks (like you have posted above), the inline comments (comments beginning with "//") will really mess things up.
Report to moderator   Logged

Hello world!
« Reply #6 on: February 27, 2008, 08:41:02 PM »
Collin1000 Offline
Newbie

View Profile WWW
*
Posts: 14



I'm not 100% on this, but if the file is all on one line with no line breaks (like you have posted above), the inline comments (comments beginning with "//") will really mess things up.
Can you do us a favor and put it all in the code tag, that way we will not lose the formatting of it orignal state. Even better, put it at a site such as  php.pastebin.com --- this will highlight the syntax and make any error stick out a bit more.
Report to moderator   Logged

~Collin
 
Pages: [1]
Send this topic | Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC