1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Frustrating echo problem

Discussion in 'PHP' started by smallmerchant, May 17, 2010.

  1. #1
    Hello,

    I am trying to pull records from a database that are actually URLs. However, when they display I want them to be active links. I can't seem to get it to work. Can anyone help?

    
    
    echo <a href="$row[1]">$row[1]</a><br>;
    
    
    
    
    PHP:
     
    smallmerchant, May 17, 2010 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    echo "<a href=".$row[1].">".$row[1]."</a><br>";


    or
    echo "<a href=\"".$row[1]."\">".$row[1]."</a><br>";


    i hope it helps

    Regards

    Alex
     
    kmap, May 17, 2010 IP
    smallmerchant likes this.
  3. smallmerchant

    smallmerchant Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you! Thank you! Thank you!
     
    smallmerchant, May 17, 2010 IP
  4. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #4
    
    
    It should be
    
    [PHP]
    
    echo "<a href="$row[1]">".$row[1]."</a><br>";
    
    or 
     <a href="<?php echo $row[1]; ?>"><?php echo $row[1]; ?></a><br>;
    
    
    
    PHP:
     
    roopajyothi, May 17, 2010 IP