Thread: PHP HREF Link

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    26
    Rep Power
    0

    PHP HREF Link


    Hi All,

    PHP Code:
    echo "<td>" ."<b>Remote URL:</b> ""<a href = $row3['Remote_URL']></a>" "&nbsp;" ."</td>"
    I have this line of code and it gives me an error when I try to run it. What I am trying to do is make the links live when they are pulled from the database. Any help would be greatly appreciated since I am not sure what I am doing wrong.
  2. #2
  3. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,112
    Rep Power
    487
    Try this instead

    PHP Code:
    echo "<td>";
    echo 
    "<b>Remote URL:</b> ";
    echo 
    "<a href = '{$row3['Remote_URL']}'>URL TEXT GOES HERE</a>";
    echo 
    "&nbsp;";
    echo 
    "</td>"
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    26
    Rep Power
    0
    Originally Posted by badger_fruit
    Try this instead

    PHP Code:
    echo "<td>";
    echo 
    "<b>Remote URL:</b> ";
    echo 
    "<a href = '{$row3['Remote_URL']}'>URL TEXT GOES HERE</a>";
    echo 
    "&nbsp;";
    echo 
    "</td>"
    I am no longer getting an error message but I now am not getting anything to return for this. The page loads but the URL is not present. Any ideas?
  6. #4
  7. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,112
    Rep Power
    487
    Does $row3['Remote_URL'] actually contain anything?
    Echo it and find out, if not then look at where it should get data from and investigate from there.
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    26
    Rep Power
    0
    Originally Posted by badger_fruit
    Does $row3['Remote_URL'] actually contain anything?
    Echo it and find out, if not then look at where it should get data from and investigate from there.
    Yes it does contain values. Previously this webpage worked fine, I just wanted to add functionality by adding live links instead of just text.
  10. #6
  11. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,112
    Rep Power
    487
    Try replacing the line:-
    echo "<a href = '{$row3['Remote_URL']}'>URL TEXT GOES HERE</a>";

    With:-
    echo "<a href = '{$row3['Remote_URL']}'>{$row3['Remote_URL']}</a>";

    Comments on this post

    • wayne12690 agrees
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    26
    Rep Power
    0
    Originally Posted by badger_fruit
    Try replacing the line:-
    echo "<a href = '{$row3['Remote_URL']}'>URL TEXT GOES HERE</a>";

    With:-
    echo "<a href = '{$row3['Remote_URL']}'>{$row3['Remote_URL']}</a>";
    That was it!!!!!! Thank you so much for your help as always!

IMN logo majestic logo threadwatch logo seochat tools logo