Parse/Syntax error

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
highchessgame
Posts: 3
Joined: Sat Jun 13, 2015 2:38 am

Parse/Syntax error

Post 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!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Parse/Syntax error

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
highchessgame
Posts: 3
Joined: Sat Jun 13, 2015 2:38 am

Re: Parse/Syntax error

Post 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!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Parse/Syntax error

Post 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
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
highchessgame
Posts: 3
Joined: Sat Jun 13, 2015 2:38 am

Re: Parse/Syntax error

Post 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
Post Reply