I use this code:
<?php
$fname = $HTTP_POST_VARS['filename'];
$ftext = $HTTP_POST_VARS['code'];
$oldurl = $_SERVER[HTTP_REFERER];
$fp = fopen($fname,"r");
if ($fp)
{
header("Location: badname.php");
}
else
{
echo "The file ".$fname." does not exist";
$fp = fopen($fname,'a');
fwrite($fp,$ftext);
header("Location: $fname");
}
?>
on Windows to see if a file is there and if not, create it and write to it. On Linux, I get these errors:
Warning: fopen(Nothing.php) [function.fopen]: failed to create stream: No such file or directory in /home/eampets/public_html/ushops/createfile.php on line 5
The file Nothing.php does not exist
Warning: Cannot modify header information - headers already sent by (output started at /home/eampets/public_html/ushops/createfile.php:5) in /home/eampets/public_html/ushops/createfile.php on line 15
createfile.php is the code I posted first. Can anyone see what changes must be made to get this to work? Thanks, Jeremy