Hello,
I have been using this code to update a text file (currenttext.txt) via a web browser. I had it on a Unix server and it was working fine. I tried it on an NT server it stopped working. I have no idea why, can someone help me?
<?php
$updates_filec1 = "currenttext.txt";
$fp = fopen($updates_filec1, "r");
flock($fp,1);
$x = fread($fp, filesize ($updates_filec1));
fclose($fp);
$x = stripslashes ($x);
$update = stripslashes ($update);
if (!empty($update_file)) {
$fp = fopen($updates_filec1, "w");
$fw = fwrite($fp, $update);
fclose($fp);
$x=$update;
echo "Changes were recorded!";
}
echo "
<FORM ACTION=\"refresh.php\" METHOD=POST>
<TEXTAREA NAME=update ROWS=20 COLS=80>$x</TEXTAREA>
<INPUT TYPE=hidden NAME=\"password\" VALUE=\"$pass\"><BR>
<INPUT TYPE=submit NAME=update_file VALUE=Save It></FORM>
";
?>
Thank You