Page 1 of 1

Parse/Syntax error

Posted: Sat Jun 13, 2015 2:53 am
by highchessgame
Script URL: http://www.phpjunkyard.com/php-guestbook-script.php
Version of script: most recent
Hosting company: altervista
URL of phpinfo.php: http://wilmingtonpets.altervista.org/gbook/phpinfo.zip
URL of session_test.php: http://wilmingtonpets.altervista.org/gb ... n_test.zip
What terms did you try when SEARCHING for a solution:

parse error
syntax error
unexpected t_string expecting ' '

Hiya, I'm trying to set up the GBook and I'm not sure what I'm doing wrong.
I am receiving the following error message:
Parse error: syntax error, unexpected T_STRING, expecting ']' in /membri/wilmingtonpets/gbook/settings.php on line 10
I did not change anything in the code besides the specified text. I've checked single and double quotes, semi-colons, and if there is any difference (that I can discern) in the line with the error in comparison to the other lines. However, I am not familiar with PHP at all, so I may just be blind/stupidly missing what is wrong.

Below, I have provided lines 6-13, line 10 being: $settings['website_title']="Wilmington Pets";

Code: Select all

/* Password for admin area */
$settings['apass’]=‘********’;

/* Website title */
$settings['website_title’]=“Wilmington Pets”;

/* Website URL */
$settings['website_url']='http://www.wilmingtonpets.altervista.org/';
Thanks in advance for your assistance!

Re: Parse/Syntax error

Posted: Sat Jun 13, 2015 7:35 am
by Klemen
What editor are you using to modify the settings file?

It could be a problem because of incorrect double quote character used (left double quotation mark versus the standard double quotes char). PHP is very picky about this.

Try this:
1. open the original, unmodified settings file in a simple text editor such as Notepad, not a "rich" text editor such as Word
2. edit only text between quotes, do not edit/change any of the quotes characters used

Re: Parse/Syntax error

Posted: Sat Jun 13, 2015 2:57 pm
by highchessgame
Hi Klemen, thank you for your prompt response.

I am on a MacBook Pro, so I've been using TextEdit to edit the file settings file. Not sure of another text editor appropriate for PHP for a Mac, but am willing to download any necessary software.

I did not change any of the text besides what was inside of quotes. Thanks again!

Re: Parse/Syntax error

Posted: Sat Jun 13, 2015 4:21 pm
by Henrie
From the setting syou have provided, the quotes in red are wrong single quotes and the qoutes in green are now double but should be single quotes.
/* Password for admin area */
$settings['apass]=********;

/* Website title */
$settings['website_title]=Wilmington Pets;

/* Website URL */
$settings['website_url']='http://www.wilmingtonpets.altervista.org/';
Unfortunately I do not have a Mac so I can not give you advice on a good text editor.
But a quick google showed me 3 possible good plain text editors: Brackets, Textmate 2, Textwrangler . But as mentioned, I was not able to test them myself.

Greetings,
Henrie

Re: Parse/Syntax error

Posted: Mon Jun 15, 2015 2:47 am
by highchessgame
Henrie, thank you for your help! I had tried fixing the single quotes before, but didn't realize the double quotes weren't right. I now have GBook up, running, and customized. Thank you, again!! :D