Keep Getting Parse Error
Posted: Fri Mar 04, 2005 9:13 am
I am getting a parse error on line 3. Can anyone tell me why I've tried everything. I am very new at this so bear with me.
feyd | please use
Code: Select all
<?php
if ($_POSTї'pw']!="") {$pw=$_POSTї'pw'];}else{$pw=$_GETї'pw'];}
$newcontent=$_POSTї'newcontent'];
$filelocation = "test.txt";
if (!file_exists($filelocation)) {
echo "Couldn't find datafile, please contact administrator!";
}
else {
$newfile = fopen($filelocation,"r");
$content = fread($newfile, filesize($filelocation));
fclose($newfile);
}
$content = stripslashes($content);
$content = htmlentities($content);
$pass="password";
if (!$pw || $pw != $pass){
$content = nl2br($content);
echo $content;
}
else {
if ($newcontent){
$newcontent = stripslashes($newcontent);
$newfile = fopen($filelocation,"w");
fwrite($newfile, $newcontent);
fclose($newfile);
echo 'Text was edited.<form><input type="submit"
value="see changes" /></form>';
}
else{
echo '<form method="post">
<textarea name="newcontent" cols="50"
rows="15" wrap="virtual">';
echo $content;
echo "</textarea>
<input type="hidden" name="pw"
value="'.$pass.'" />
<br /><input type="submit" value="edit" />
</form>';
}
}
?>feyd | please use
Code: Select all
tags whileCode: Select all
is offline[/color]