PHP Include Function Error, How To Fixed That?
Since PHP5 launched, by default PHP include function has disabled (look at line 580). So if your PHP script / installation have require this function, your browser will showing kind of these error: Warning: include() [function.include]: URL file-access is disabled in the server configuration in -your path-
PHP include have been disabled because in many case thats not safe to remote files with this function. Script with PHP Include will be an open target to cross site scripting attacks (XSS attacks), or other injection that can make your site defaced.
You may usually using include function for grabbing content from other / external source. So what alternative to change Include function so your code can working?
Using file_get_content Function As Alternative
For example, we want to grab CNN latest news, the old include function code:
<?
include ("http://rss.cnn.com/rss/cnn_latest.rss");
?>
Modified / exchange using file_get_content:
<?
$rss = file_get_contents("http://rss.cnn.com/rss/cnn_latest.rss");
echo ($rss);
?>
Download sample PHP CNN Latest news
Related posts:
Tweet This





