×
  • remind me tomorrow
  • remind me next week
  • never remind me
Subscribe to the ANN Newsletter • Wake up every Sunday to a curated list of ANN's most interesting posts of the week. read more

Forum - View topic
Newsfeed Question




Anime News Network Forum Index -> Site-related -> Bugs & Technical Questions
View previous topic :: View next topic  
Author Message
Solik



Joined: 10 Aug 2005
Posts: 3
PostPosted: Mon Jul 03, 2006 10:58 pm Reply with quote
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.
Back to top
View user's profile Send private message
Dan42
Chief Encyclopedist


Joined: 02 Jan 2002
Posts: 3794
Location: Montreal
PostPosted: Tue Jul 04, 2006 12:35 am Reply with quote
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.
Back to top
View user's profile Send private message Visit poster's website AIM Address My Anime My Manga
Display posts from previous:   
Reply to topic    Anime News Network Forum Index -> Site-related -> Bugs & Technical Questions All times are GMT - 5 Hours
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group