I need some suggestions on what to try.
The server i am using is running PHP Version 4.3.0
I am getting this error:
Parse error: parse error, unexpected T_VARIABLE in F:\wwwroot\news\update.php on line 5
Here is the code:
<?php
$password = "password"; // define user password
$filename = "message.txt"; // define the text filename
if ($_POST['change_text'] == "yes") { // if the button was pushed
$text = rtrim($text); // trim extra newline characters from the text
$text=stripslashes($text); // remove escape slashes from posted data
$file = fopen($filename, "w"); // open the text file
fputs($file, $text); // write the cleaned up text to the file
fclose($file); // close the text file
}
echo "<html>";
echo "\n<head>";
echo "\n<title>News Message</title>";
echo "\n</head>";
echo "\n<body bgcolor=\"#ffffff\">";
if ($POST['pw'] == $password) { // if the password is correct, display edit form
echo "\n<form action=\"".$SERVER['PHP_SELF']."\" method=\"post\">";
echo "\n<input type=hidden name=\"change_text\" value=\"yes\">";
echo "\n<input type=hidden name=\"pw\" value=\"$password\">";
echo "\n<table align=\"center\" width=\"590\"><tr><td>";
include($filename); // include the text, so you can see it in HTML
echo "\n</td></tr><tr><td align=\"center\">";
echo "\n<textarea cols=\"90\" rows=\"15\" name=\"text\">";
include($filename); // include the text in textarea box
echo "\n</textarea>";
echo "\n<p><input type=submit value=\"Change Text\">";
echo "\n</td></tr></table>";
echo "\n</form>";
} else { // if pw is not correct, display the login form again
echo "\n<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">";
echo "\nMessage Text: (Type in your password!)<br>";
echo "\n<table align=\"center\" width=\"590\"><tr><td align=\"center\">";
echo "\n<input type=password name=\"pw\">";
echo "\n<p><input type=submit name=change_message value=\"Enter Password\">";
echo "\n</td></tr></table>";
echo "\n</form>";
}
echo "\n</body>";
echo "\n</html>";
?>