News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

parse error in settings.php

Started by shepdawg, November 24, 2008, 02:50:48 PM

Previous topic - Next topic

shepdawg

Hello, I have had my forums running for about 6 months now with no problems, but today my users get this message when they try to get to the forums:
Parse error: parse error, unexpected T_STRING in /home/mrshep5/public_html/sas/forum/Settings.php on line 29

I have not edited the settings.php file, but I did try renaming the settings_bak.php file to settings.php and overwriting it. That did not work.

I have attached the settings.php file.
What do I need to do to fix this problem?

Antechinus

Oh dear. No, that would not work. Ok, which file have you attached?

Is it the original one which was giving the error or is it the one that should still be called Settings_bak.php?

Do you have a backup copy of Settings_bak.php? You're going to need one.

shepdawg

The settings_bak and settings file look exactly the same.

Antechinus

Sorry, you're right in this case. Coffee time. Anyway the parse error is caused by the apostrophes in the text on that line. With php you have to do them like this:     we\'re

This is because a plain apostrophe is used all over the place as part of php coding. I've fixed it. 

swtdivalove

Just as an added reminder... If you're statement begins with an apostrophe, it must also end in an apostrophe, just like with quotation marks.

Example:
<?php

$string1 
'Hello World!';
$string2 "Hello World!";

?>


Both will work. :)

But this will also work:

<?php

$string3 
'some string\'s go here!';

?>


And, last but not least...


<?php

$strings4 
"some string's go here!";

?>


Hope this helps! :)

shepdawg

antechinus, thank you so much for fixing the file for me.
Thank swt for explaining the "

swtdivalove


Advertisement: