Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\Program Files (x86)

This is an assignment for class. I have tried everything I can to get this to work. Any assistance or guidance would be greatly appreciated. Code below:

[php]

Assignment10 ">

Enter your name:

Enter your comments:

<?php if ($_POST['submit']) { $myFileIn = fopen("feedback.txt", "a"); if ($myFileIn) { fputs($myFileIn, $_POST['name']."\n"); fputs($myFileIn, $_POST['comments']."\n"); echo "

Thanks for your feedback.

"; fclose($myFileIn); } else ($_POST['view']) echo "<pTry again." } elseif ($_POST['view']) $myFileOut = fopen("feedback.txt", "r"); while (!feof($myFileOut)) { echo "

"; echo fgets($myFileOut); echo "

"; } fclose($myFileOut); } ?> [/php]

If you look at line 29; else doesn’t take an expression. Might you mean elseif?

Sponsor our Newsletter | Privacy Policy | Terms of Service