TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Content Updater

Page: 1 Reply
Jan 9th 2005#164574 Report
Member since: Jul 19th 2003
Posts: 810
Hey,

I am just trying to finish up a website that I am writing. It needs to be easily updatable and so I am trying to work a script that I found in a tut over at spoono.com which lets me update the content on a website without changing the source code .: making it easier to update without notepad and trawling through Code.

So I have got this so far:
[QUOTE]
[HTML]


Update it Yourself











[/HTML][/QUOTE]

That's the table that would have the info put into it. and then the file that would edit the file looks like:
[QUOTE]
[PHP]$filename = $_POST["filename"];
$theText = $_POST["theText"];
$theText = stripslashes($theText);
$data = fopen($filename, "a");
fwrite($data,$theText);
fclose($data);
echo "File created or updated";
?>[/PHP][/QUOTE]

But, when I test it out it returns the error :


Warning: fopen(text.htm): failed to open stream: Permission denied in /home/lazyroll/public_html/tests/post.php on line 5

Warning: fwrite(): supplied argument is not a valid stream resource in /home/lazyroll/public_html/tests/post.php on line 6

Warning: fclose(): supplied argument is not a valid stream resource in /home/lazyroll/public_html/tests/post.php on line 7
File created or updated


Does anyone have any idea why? You can test it out o ver at:

http://www.pixelated-designs.co.uk/tests/update.htm

There is a file called: text.htm you can edit that if you want to try it.

What's is wrong with the code?
Marc
Reply with Quote Reply
Jan 30th 2005#165258 Report
Member since: Dec 17th 2004
Posts: 43
you need to set permissions on that file/folder so that all can edit/add/delete.... depending on your FTP program, set the folder that text.htm resides in to '777', or check all of the options (something like read write execute etc) that shoudl take care of your problem
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum