Changing value of Link

Discussion in 'PHP' started by dhrystone, Dec 20, 2007.

  1. #1
    I have a certain doubt regarding how to do the following,

    I have a small section called preferences which include the follow

    Some setting - Yes / No

    where the yes and no are links, now i want one of them disabled and one of them enabled.
    For example, when i click on yes link yes link will be disabled and No link will appear and vice versa.

    Can anyone tell me how do i do it?
     
    dhrystone, Dec 20, 2007 IP
  2. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would just do something like the following:

    
    <?php
    
    if($prefs['option'] === TRUE) {
        echo 'YES / <a href="link here">NO</a>';
    } else {
        echo '<a href="link here">YES</a> / NO';
    }
    
    ?>
    
    PHP:
     
    streety, Dec 20, 2007 IP