Variable hyperlinks

Discussion in 'HTML & Website Design' started by green4rrow, Jul 15, 2012.

  1. #1
    Hi

    What is the correct formatting of the following code to show the correct link depending on whether the user is signed in or not (my account if signed in, login if not signed in) Thanks in advance



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




     $acc_link = tep_href_link('account.php');
     $acc_title= HEADER_TITLE_MY_ACCOUNT;
    } else{ 
     $acc_link = tep_href_link('login.php');
     $acc_title= HEADER_TITLE_LOGREGISTER;
    } 
    ?>              
                                        
                        <table border="0" cellspacing="0" cellpadding="0" align="right">
                            <tr><td style="padding:13px 0px 0px 0px;"> <?php echo tep_href_link('<?php echo $acc_link;?>')?>"><?php echo $acc_title;?></a>
     
    green4rrow, Jul 15, 2012 IP
  2. green4rrow

    green4rrow Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    never mind. a simple a href tag works with a php recall
     
    green4rrow, Jul 15, 2012 IP