I'm running some PHP code, but I just can't get it to work. It's not even complicated
I created a simple PHP file to test out the code that didn't work, here it is:
And when I run the file I get the following:
I've tried setin the permissions on the files to 755, then even 777. But nothing changes.
What am I doing wrong?
Thanks for any help!
I created a simple PHP file to test out the code that didn't work, here it is:
| Code: |
| <?php
$var1 = '4'; $var2 = '5'; $var3 = '6'; $filepath = 'writeThis.txt'; $writeText = '$var1 = ' . $var1 . "\n" . '$var2 = ' . $var2 . "\n" . '$var3 = ' . $var3; $Open = fopen($Filepath,"w+"); fwrite($Open, $writeText, 100); fclose($Open); ?> |
And when I run the file I get the following:
| Quote: |
|
Warning: fwrite(): supplied argument is not a valid stream resource in previous_path/public_html/open_write_close.php on line 11 Warning: fclose(): supplied argument is not a valid stream resource in previous_path/public_html/open_write_close.php on line 12 |
I've tried setin the permissions on the files to 755, then even 777. But nothing changes.
What am I doing wrong?
Thanks for any help!
