Need help in PHP

Discussion in 'PHP' started by sachum, Feb 26, 2008.

  1. #1
    Hello Senior Players,
    We would like to integrate RSS feed in PHP form on our webpage.
    Is it possible to provide some inputs or code?
    Currently javascript is implemented but as you all know that they are not search engine friendly.
    So please provide some resources with the help of which we can integrate rss feed,php based,on our existing page.
    Thanks and waiting for your cooperation
    Sachu
     
    sachum, Feb 26, 2008 IP
  2. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Morishani, Feb 26, 2008 IP
  3. sachum

    sachum Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    We think we mentioned it in some wrong manner.
    We need to integrate http://feeds.business-standard.com/News-Now.xml on our existing webpage in php format.
    Could you please advice us?
    thanks
    regards
     
    sachum, Feb 26, 2008 IP
  4. Marko

    Marko Peon

    Messages:
    248
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    RSS is in XML not PHP format...
    So u can use PHP to generate your XML file on the fly.

    Usual concept:
    U have a table in database, and when u add a new item in table your script need to select data from table and write it in to the xml file.

    And if you want to integrate feed from an external page you will need some XML parser
     
    Marko, Feb 26, 2008 IP
  5. sachum

    sachum Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hello,
    http://feeds.business-standard.com/News-Now.xml is the feed.
    We want to display the out of this feed on our webpage.
    How can we do this? please Can anyone explain this in steps?
    thanks and waiting for your cooperation
    regards
     
    sachum, Feb 27, 2008 IP
  6. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #6
    Grab rss2html, the free version from here : http://www.rss2html.com/
    Set it up, modify the template and call it as a php include file on whatever page(s) you want it to show.
     
    shallowink, Feb 27, 2008 IP
  7. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    jnestor, Feb 27, 2008 IP
  8. nastynappy

    nastynappy Banned

    Messages:
    499
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #8
    search on hotscripts.com about rss parser, you will get most helpful results there, i have used them :)
     
    nastynappy, Feb 27, 2008 IP
  9. juust

    juust Peon

    Messages:
    214
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    
    <?php
    
            do{
                $xml = @simplexml_load_file('http://feeds.business-standard.com/News-Now.xml');
                if(!$xml){
                    $Tries++;
                    sleep(1);
                    }
                }while(!$xml && $Tries < 4);
    
            if($xml){
    			foreach ($xml->channel->item as $item) {
    			    print $item->title."<br />";
    		    	    print $item->link."<br />";
    			    print $item->description."<br /><br />";
    			}
    		} else { echo 'no xml file retrieved';}
      
    
    ?>
    
    PHP:
    if your site document is a .php-file, just add the code somewhere halfway, or if it is an .html-file, save it as .php-file and add the code somewhere halfway

    try putting it in a div with a scrollbar (keeps your page intact)

    <div style="background-color: white; width:600px; height:250px; border: 1px solid white;overflow:auto"> [code....]</div>
     
    juust, Feb 27, 2008 IP