Guest Posted September 19, 2008 Share Posted September 19, 2008 i am trying to debug the following: I believe it is supposed to switch "create account" and "log in" to "my account" and "log off" after the user signs in. <? if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link('account.php')?>"><?php echo HEADER_TITLE_MY_ACCOUNT?></a><? } else { ?><a href="<?php echo tep_href_link('create_account.php')?>"><?php echo HEADER_TITLE_CREATE_ACCOUNT?></a><? } ?> <?php echo tep_image(DIR_WS_IMAGES.'nav_arrow.gif')?> <? if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link('logoff.php')?>"><?php echo HEADER_TITLE_LOGOFF?></a><? } else { ?><a href="<?php echo tep_href_link('login.php')?>"><?php echo HEADER_TITLE_LOGIN?></a><? } ?> I am not a php coder and would appreciate help understanding this parse error. Thanks, thomas Link to comment Share on other sites More sharing options...
germ Posted September 19, 2008 Share Posted September 19, 2008 <? if (tep_session_is_registered('customer_id')) { ?> <a href="<?php echo tep_href_link('account.php'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> <? } else { ?> <a href="<?php echo tep_href_link('create_account.php');?>"><?php echo HEADER_TITLE_CREATE_ACCOUNT; ?></a> <? } ?> <?php echo tep_image(DIR_WS_IMAGES.'nav_arrow.gif'); ?> <? if (tep_session_is_registered('customer_id')) { ?> <a href="<?php echo tep_href_link('logoff.php'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a> <? } else { ?> <a href="<?php echo tep_href_link('login.php'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a> <? } ?> All I did was put missing semi-colons on some of the PHP code. ;) If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
sLaV- Posted September 19, 2008 Share Posted September 19, 2008 you should also set up your links for SSL (so when you do have it you won't have to change the links) ... so the main ones in these are Create account, Login and My Account....change them to: echo tep_href_link('login.php', '', 'SSL'); echo tep_href_link('create_account.php', '', 'SSL'); echo tep_href_link('account.php', '', 'SSL'); Link to comment Share on other sites More sharing options...
Guest Posted September 19, 2008 Share Posted September 19, 2008 <? if (tep_session_is_registered('customer_id')) { ?> <a href="<?php echo tep_href_link('account.php'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> <? } else { ?> <a href="<?php echo tep_href_link('create_account.php');?>"><?php echo HEADER_TITLE_CREATE_ACCOUNT; ?></a> <? } ?> <?php echo tep_image(DIR_WS_IMAGES.'nav_arrow.gif'); ?> <? if (tep_session_is_registered('customer_id')) { ?> <a href="<?php echo tep_href_link('logoff.php'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a> <? } else { ?> <a href="<?php echo tep_href_link('login.php'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a> <? } ?> All I did was put missing semi-colons on some of the PHP code. ;) thanks for the assistance. now i get this: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\shop_mln\oscs\includes\header.php on line 85 what do i do now? Link to comment Share on other sites More sharing options...
germ Posted September 19, 2008 Share Posted September 19, 2008 If you copy/pasted the code I posted, that's NOT the problem. I tried it out before I posted it. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Guest Posted September 19, 2008 Share Posted September 19, 2008 If you copy/pasted the code I posted, that's NOT the problem. I tried it out before I posted it. thanks, i must have pasted it wrong. now the issue is that both the log in/log off still show up. any suggestions (besides removing the feature):-) much appreciated Thomas Link to comment Share on other sites More sharing options...
germ Posted September 19, 2008 Share Posted September 19, 2008 Again, it's not a code problem (at that point in the code anyway). On my site it shows "Create Account" or "Login" when not logged in, and switches to "My Account" and "Logoff" after logging in. I don't know what to say. :huh: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.