anchor tag and php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartic
    New Member
    • May 2007
    • 150

    anchor tag and php

    //My code
    <?php
    if($age==25){
    echo "My age is: ".$age." Years old <br />";
    echo "<script type='text/jscript'>window .alert('are you sure your age is $age?')</script>";
    }
    else{
    // i need the anchor tag to be visible not this part of code after i click how can id that thx
    echo "You are liar <br />";
    exit;
    }
    ?>
    <a href="?age=25"> My age is</a>
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    You can control the visibility of the anchor tag by condition of you just put the anchor tag IN the condition, just like you did with the script tag.

    And next time, please don't ask your question within your code. For one, you hardly made sense. In fact, I'm halfway sure this isn't even the question you asked.

    Comment

    Working...