|
Posted by Chris on 02/27/06 21:31
Here is some sample code from my script.
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
error_reporting(0);
$filename = $_GET['textfilename'];
$contents = $_POST['writevar'];
$filetype = strstr($filename, '.txt');
if ($filetype <> '.txt') {
echo 'Error. Cannot open file.';
exit;
}
touch($filename);
chmod($filename,0777);
if (!$handle = fopen($filename, 'w')) {
echo "Error. Cannot open file.";
fclose($handle);
exit;
}
if (fwrite($handle, $contents) === FALSE) {
echo "Error. Cannot write to file.";
fclose($handle);
exit;
}
echo "Success";
fclose($handle);
?>
<joelbyrd@gmail.com> wrote in message
news:1141068188.676297.326530@e56g2000cwe.googlegroups.com...
> To help you out, we need some code.
>
Navigation:
[Reply to this message]
|