Jump to content

mercuryfenix

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mercuryfenix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've been playing around with the chmod() but I am going in circles. My last post got bumped down too far and nobody is responding. I am getting the following error with this code: Warning: fopen(rss.xml) [function.fopen]: failed to open stream: Permission denied in /rss/update_rss.php on line 31 Warning: fwrite(): supplied argument is not a valid stream resource in /rss/update_rss.php on line 32 Warning: fclose(): supplied argument is not a valid stream resource in /rss/update_rss.php on line 33 $path="rss.xml"; $file_name=fopen($path,"w"); fwrite($file_name,$body); fclose($file_name); ?>
  2. ok so i got this far...still getting an error Parse error: syntax error, unexpected T_STRING with this code...this is just the bottom part of the code from above but modified slightly....i dont understand chmod fully; $body .=" </channel> </rss>"; echo $body; $path="rss.xml"; chmod u+rw rss; $file_name=fopen($path,"w") or die("can't open file"); fwrite($file_name,$body); fclose($file_name); chmod u-rw rss; ?>
  3. hmm ok so I scanned through the permissions links posted above...how do I implement a permissions change? from what I gather I need to do something with $ chmod [references][operator][modes] file1 ... and to give a user named mercuryfenix read and write permissions... $ chmod u+rw rss what do I do with this? ??? sorry if this is a nub question!
  4. I use a shared hosting service online to host the site that this is on....is there a security vulnerability that could cause them to disallow fwrite() on my server? I have checked the permissions and they appear to be right to me.
  5. trying to update an xml file from PHP....any help would be appreciated! it is supposed to open the outdated rss.xml and update it with the latest 6 entries from the table.... must be something wrong with the opening of the file...getting the error: Warning: fopen(rss.xml) [function.fopen]: failed to open stream: Permission denied in /home/mysiteinfo/public_html/mysiteinfo/rss/update_rss.php on line 31 can't open file <? ///////// Connect to the DB /////////////////////////////////////////// require_once('../mysql_connect.php'); ///////// Getting the data from Mysql table for first list box //////// $quer2=mysql_query("SELECT * FROM rss ORDER BY rss_id DESC LIMIT 0,6"); ///////// End of query for first list box ///////////////////////////// $body="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?> <rss version=\"2.0\"> <channel> <title>My Site Name</title> <link>http://www.mysite.com</link> <description>my site description</description> <copyright>(c) 2007, mysite.com. All rights reserved.</copyright> "; while($nt = mysql_fetch_array($quer2)) { $body .=" <item> <title>$nt[title]</title> <link>$nt[link]</link> <description>$nt[description]</description> <pubDate>$nt[pubdate]</pubDate> </item>"; } $body .=" </channel> </rss>"; echo $body; $path="rss.xml"; $file_name=fopen($path,"w") or die("can't open file"); fwrite($file_name,$body); fclose($file_name); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.