Using anchors

Discussion in 'PHP' started by enchance, Oct 10, 2007.

  1. #1
    Not sure is this is a php question but I'm using PHP to generate it so I thought I'd post it here.

    I'm trying to target an anchor while at the same time passing variables using GET. I just need to know the right way to do it. Is it something like this:
    
    <?php
    //this is the link without the anchor
    echo "<a href = \"mypage.php?var1=a&var2=b...\">";
    
    //do I write the anchor named "toplinks" like this
    echo "<a href = \"mypage.php#toplinks?var1=a&var2=b...\">";
    //I'm not 100% certain that that would work
    ?>
    
    PHP:
    How do I go about this one?
     
    enchance, Oct 10, 2007 IP
  2. *louie*

    *louie* Peon

    Messages:
    48
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    echo "<a href = \"mypage.php?var1=avalue&var2=bvalue#toplinks\">";
    
    PHP:
    you put it at the end of the url using the # key
     
    *louie*, Oct 10, 2007 IP
  3. enchance

    enchance Peon

    Messages:
    109
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh! At the end! Thanks!
     
    enchance, Oct 10, 2007 IP