Jump to content

php if else statement and less than brilliant formatting


chen2424

Recommended Posts

Hi Guys,

 

this code seems to work in my osc header.php but it causes a slight conflict with another register function. Ive streamlined problem to be in this peice code, probably the if else part, can someone help out here pls, my php is far fm brilliant :-[, but im trying man.... thanks in advance! 8)

 

<table>

<?php if (tep_session_is_registered('customer_id')) {?>



<a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo  tep_image(DIR_WS_IMAGES . 'buttonlogout.jpg', HEADER_TITLE_LOGOFF); ?></a>

<a href="account_history.php"><img border="0" src="images/orderhistory.png"></a>

<tr><td><?php  }else{
echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'));?></td></tr> 
<tr><td>Email       :<?php echo tep_draw_input_field('email_address');?></td></tr> 
<tr><td>Password:<?php echo tep_draw_password_field('password');?></td></tr> 
<tr><td><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN);
  } ?></td></tr> 

</table> 

 

kind regards, Chen

Link to comment
Share on other sites

... not that i can see?

 

only problems i can see are HTML errors with your <tr> and <td> tags?

if the 'else' block executed, the first table row wouldn't have an opening <tr><td>, just a closing <tr><td>

 

try

<table>

<?php if (tep_session_is_registered('customer_id')) {?>



<a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo  tep_image(DIR_WS_IMAGES . 'buttonlogout.jpg', HEADER_TITLE_LOGOFF); ?></a>

<a href="account_history.php"><img border="0" src="images/orderhistory.png"></a>

<?php  }else{ ?>
<tr><td><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'));?></td></tr>
<tr><td>Email       :<?php echo tep_draw_input_field('email_address');?></td></tr>
<tr><td>Password:<?php echo tep_draw_password_field('password');?></td></tr>
<tr><td><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?>
</td></tr>
<?php } ?>

</table> 

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.