-
$end error
Whats wrong with this file
Heres the error message:
Code:
Parse error: syntax error, unexpected $end in C:\Program Files\Apache Group\Apache2\htdocs\forums\write.php on line 30
Heres the location of the file;
http://jcampbe.homelinux.com/forums/write.php
The funny thing is line 30 doesnt exist!
- Justin
-
It's impossible to view a PHP file's source over the Internet (assuming that your server is properly set up) because PHP is server-side-interpreted.
Post the file's source here, please.
-
Heres The Source
Code:
<html>
<head>
</head>
<body>
<?php
$nickname = isset($_POST['nickname']) ? $_POST['nickname'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
$action = isset($_POST['action']) ? $_POST['action'] : '';
if($action == 'Clear'){
$f = fopen('forum.php','a');
$text = <<<EOT
fwrite($f,$text);
fclose($f);
}
else if($nickname && $message){
$f = fopen('messages.html','a');
fwrite($f,"$nickname
$message
\n");
fclose($f);
}
echo ("Your Message has been Posted,");
echo ('Click Here to Continue');
?>
</body>
</html>
- Justin
-
Don't you need a line with "EOT" in it to terminate the hereis document?
-
Umm ... yes and there was a bunch of code that didnt belong ... Thanks for all your help, if i have anymore problems ill post again.
- Justin