Tutorials Home Scripts Home

Discussion home » PHP Scripts » Open Question

Add no follow to php generated links

This below is a rss feed code. Can any of you guys tell me how to make all the links generated by this code be rendered nofollow.

<?php
$olderror_reporting =error_reporting(0);
include ("http://rssfeedreader.com/rss3/rss.php");
error_reporting($olderror_reporting);
?>

Category: PHP Scripts Discussions & Requests | about: 2 months ago; | By: andy_ameed

Last 6 Responses

Comment form

  1. jooria About 2 months ago
    see i will give you general code its put the rel='nofollow' for any <a> ok
    function nofollow($text){
    
    $text = preg_replace('/(<a[\s\r\n] [^>] )>/i', '\\1 rel="nofollow">',$text);
    
    return $text;	
    }
    
    and your code will not working because you shuld use:
    file_get_contents();

    and if you want an RSS parser
    you can find one here
  2. andy_ameed About 2 months ago
    please provide it within the code, i do not know how to integrate it inside. Thanks
  3. jooria About 2 months ago
    ok if you want that you should tell me what are you tring to to because your code will not working are you tring to get the content of rss?
  4. jooria About 2 months ago
    and if you tring to get the file contents use this
    $file = file_get_contents("url here");
    $file = nofollow($file);
    echo $file;
    
    and you can use the simple html dom i cant do what are you want because i dont know what are you tring to do
  5. andy About 2 months ago
    Actually, its not a file.. it a dynamic rss content that is being called. that code is not working.
  6. jooria About 2 months ago

Leave a Comment

Comment form