Write to .txt file
Posted: Sun Aug 14, 2005 3:07 pm
I have just started using php on my mac os x and I'm going through a tutorial in a book using php with flash. I'm on the first excersize and having trouble already. Think it could be a configuration issue but thought I'd see if anyone could see a simple fix. Here is the php code that I'm using, which the book has given me.
When I run it I get this:
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown: Failed opening '/Users/Admin/Sites/phpflash/ch02/feedback.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in Unknown on line 0
Is there something wrong with the file location and is that why its not creating a .txt file?
JCART | Please use
Code: Select all
<?php
foreach ($_POST as $key=>$value) {
$received .= "$key = $value\r\n";
}
$printout = fopen("variables.txt", "w");
fwrite($printout, $received);
fclose($printout);
?>Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown: Failed opening '/Users/Admin/Sites/phpflash/ch02/feedback.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in Unknown on line 0
Is there something wrong with the file location and is that why its not creating a .txt file?
JCART | Please use
Code: Select all
tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]