php Question

Discussion in 'PHP' started by stock_post, Nov 2, 2012.

  1. #1
    Hi All,

    if I have a line in my php code
    "<td colspan="3" valign="top"><div align="left"><a href="<?=$web?>" target="_blank">"

    How to make this a a no-follow link?

    changed to

    "<td colspan="3" valign="top"><div align="left"><a rel="nofollow" href="<?=$web?>" target="_blank">"

    is that good - or any other choices / better options?

    Appreciate any help

    thanks
     
    stock_post, Nov 2, 2012 IP
  2. playreblox

    playreblox Greenhorn

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    The Description on Nofollow is "Links to an unendorsed document, like a paid link. ("nofollow" is used by Google, to specify that the Google search spider should not follow that link)".

    I hoped this helped you.
    ;)


     
    Last edited: Nov 3, 2012
    playreblox, Nov 3, 2012 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    Yes is the answer! :)
     
    EricBruggema, Nov 3, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    Stop using <? is also an answer. Most sites have short tags disabled (and it's deprecated in PHP 6), so <?= will cause the interpreter to barf. Use <? echo instead. It's only 4 more keys to hit and it makes your code universal.
     
    Rukbat, Nov 3, 2012 IP
  5. arsalankhan

    arsalankhan Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    6
    Trophy Points:
    0
    #5
    Well IMO don't use even <? echo, make your script future proof and use
    <?php
    echo
    ?>
     
    arsalankhan, Nov 3, 2012 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    While that is 'good' for setting nofollow -- it's not good markup... since the VALIGN, ALIGN and TARGET attributes have no place on any website written after 1998, since that's presentation, not description. That DIV is also likely in there for no good reason since that's just setting a left/right alignment -- something that could just as easily go on the TD.
     
    deathshadow, Nov 4, 2012 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    Sorry, my typo - you're correct.
     
    Rukbat, Nov 4, 2012 IP