26-10-2011

PHP Simple RSS proxy script PHP

The first line of following php code produces an http header signifying that the content will be an xml file.

The second will simply retrieve the file or url and print out the contents.

This makes it easy to retrieve and display the remote rss feed on your own server / domain , thus preventing cross domain scripting issues when opening / parsing them using in JavaScript.

<?php
header ("Content-Type:text/xml");
 
echo file_get_contents('http://blablabla.coml/rss.xml');
Keywords: RSS proxy

Comments:

Your comment:

»
Zolee 04/11/2011, 1:54 pm
Thanks a lot. Great help! Works perfectly.

 

[x]