How to add no follow

Discussion in 'PHP' started by ezymoneyathome, May 14, 2008.

  1. #1
    I have a script that automatically adds links to my site. Im wondering if i can add no follow to these. There sold links and want to keep them not available.

    Here is the code:

    <?
    if ( $_POST['action'] )
    {
    if ( empty($_POST['id']) )
    {
    $sql = "INSERT INTO related_link (name,link,orders) VALUES('".$_POST['name']."','".$_POST['link']."',".$_POST['orders'].")";
    $db->Execute( $sql );
    echo "<font color=red>Related Link Added!</font>";
    }
    else
    {
    $sql = "UPDATE related_link SET name='".$_POST['name']."',link='".$_POST['link']."',orders=".$_POST['orders']." WHERE id=".$_POST['id'];
    $db->Execute( $sql );
    echo "<font color=red>Related Link Edited!</font>";
    }
    }

    if ( $_GET['id'] )
    {
    $sql = "SELECT * FROM related_link WHERE id=".$_GET['id'];
    $rs = $db->Execute( $sql );
    $name = $rs->fields['name'];
    $link = $rs->fields['link'];
    $orders= $rs->fields['orders'];
    }

    ?>
    <form id="form2" name="form2" method="post" action="">
    <div class='tableborder'>
    <div align="left" class="tableheaderalt"><?=$_GET['id'] ? 'Edit' : 'Add'?> Related Link </div>
    <table width="100%" cellspacing='0' cellpadding='5' align="center">
    <tr class="tablerow1">
    <td>Site Name</td>
    <td>
    <input name="name" type="text" value="<?=$name?>" size="40"/>
    </td>
    </tr>
    <tr class="tablerow1">
    <td>Site Link</td>
    <td>
    <input name="link" type="text" value="<?=$link?>" size="40"/>
    </td>
    </tr>
    <tr class="tablerow1">
    <td>Order</td>
    <td>
    <input name="orders" type="text" value="<?=strlen($orders)>0 ? $orders : '0' ;?>" size="40"/>
    </td>
    </tr>
    <tr>
    <td colspan="2" class='pformstrip' >
    <input name="id" type="hidden" value="<?=$_GET['id'] ? $_GET['id'] : '';?>" />
    <input name="action" type="hidden" value="a" />
    <input id='button' type="submit" name="Submit" value="<?=$_GET['id'] ? 'Edit' : 'Add'?> Related Link" />
    </td>
    </tr>
    </table>
    </div>

    Any help would be appreciated.

    Thanks in advance
     
    ezymoneyathome, May 14, 2008 IP
  2. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you looking for the no follow for search engines? That would be in your robots.txt file.
     
    Altari, May 14, 2008 IP
  3. ezymoneyathome

    ezymoneyathome Active Member

    Messages:
    836
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Im not sure about how to create a no follow for SE in robot file. I would only want this area to be no follow.

    Thanks
     
    ezymoneyathome, May 14, 2008 IP
  4. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I looked it up. From what I found, although I'm not sure how up to date the info is, using rel="nofollow" in your "a" item may work.
     
    Altari, May 14, 2008 IP
  5. salihpk

    salihpk Banned

    Messages:
    689
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This is the code to add link and not the display code.In display code u have to add like this <a href="" rel="nofollow">
     
    salihpk, May 14, 2008 IP