Forum - View topicNewsfeed Question
|
Author | Message | ||
---|---|---|---|
Solik
Posts: 3 |
|
||
I keep getting these errors (changed the username and pass for security reasons)
Warning: file(http://animenewsnetwork.com/newsfeed/getnews.php?u=test&p=yuptesttest): failed to open stream: Permission denied in /home/u1/threat/html/thenews.php on line 25 Warning: implode(): Bad arguments. in /home/u1/threat/html/thenews.php on line 26 the code is as follows: // Connect to database $mysql_connection = mysql_connect("localhost", "test", "yup"); if (!$mysql_connection) die("mysql_connect() failed"); if (!mysql_select_db("test", $mysql_connection)) die("mysql_select_db() failed"); // Fetch the stored news $result = mysql_query("SELECT * FROM annNews"); if (!$result) die(mysql_error()); $annNews = mysql_fetch_array($result); // If the news were last updated more than one hour ago, re-update them if ($annNews['last_query'] < time() - 3600 or trim($annNews['news']) == "") { // Fetch the news from ANN // You need to put your own username and password here $a = file("http://animenewsnetwork.com/newsfeed/getnews.php?u=test&p=yup"); $n = addslashes(trim(implode("", $a))); // Save the news to the database $query = "UPDATE annNews SET last_query=UNIX_TIMESTAMP()"; if ($n) { $query .= ", news='$n'"; $annNews['news'] = stripslashes($n); } mysql_query($query); } // Display the news echo $annNews['news']; Direct linking to http://animenewsnetwork.com/newsfeed/getnews.php?u=test&p=yuptesttest works fine though, so I know it's on my end. Any help, even if its a point in the right direction would be much appreciated. |
|||
|
|||
Dan42
Chief Encyclopedist
![]() Posts: 3794 Location: Montreal |
|
||
I would say this is either a problem with the fopen wrappers or with safe mode.
Normally a filename that begins with "http://" would cause the file to be fetched from the internet instead of the filesystem, but if the fopen URL wrappers are not enabled, you might get that kind of permission error. |
|||
|
|||
All times are GMT - 5 Hours |
||
|
Powered by phpBB © 2001, 2005 phpBB Group