Page 1 of 2

so the security number keeps coming up as wrong

Posted: Thu Apr 19, 2012 5:51 pm
by larryfowler24
Script URL: http://www.unitedcoachtours.com/gbook/gbook.php
Version of script: latest
Hosting company: hostmonster
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
The security number keeps coming up wrong....

Re: so the security number keeps coming up as wrong

Posted: Fri Apr 20, 2012 9:16 pm
by Henrie
Please post the following so we can try to help find the source of the problem:
URL of phpinfo.php:
URL of session_test.php:

If you do not know what to do with the above, read the following viewtopic.php?f=7&t=83 under b)

Greetings,
Henrie

Re: so the security number keeps coming up as wrong

Posted: Sat Apr 21, 2012 1:04 am
by larryfowler24
First....initially the image was not showing up in the 'captcha' form - http://www.unitedcoachtours.com/gbook/gbook.php?a=sign

so I changed it so only random numbers show up....(not sure how I did that).....
But now a person enters the numbers and the form says they are incorrect...??

hello the files can be found at.....

http://www.unitedcoachtours.com/phpinfo.php

http://www.unitedcoachtours.com/session_test.php

Re: so the security number keeps coming up as wrong

Posted: Sat Apr 21, 2012 9:14 am
by Klemen
Something seems to be breaking GBook sessions - my money is on an error in the gbook.php file.

Try this:
1. backup your existing gbook.php file
2. download GBook again.
3. upload a fresh copy of gbook.php file to your server. Do NOT open the fresh gbook.php in any editor or make any changes inside, just upload it to the server.

Does this fix the issue?

By the way - to show captcha image rather than text number set

Code: Select all

$settings['autosubmit']=2;
to

Code: Select all

$settings['autosubmit']=1;
in settings.php file.

Re: so the security number keeps coming up as wrong

Posted: Mon Apr 23, 2012 10:22 pm
by larryfowler24
Hello,
I uploaded a fresh gbook.php......
It didn't fix it.....

Re: so the security number keeps coming up as wrong

Posted: Mon Apr 23, 2012 11:01 pm
by Henrie
Could you please also replace the header.txt file with the original empty file? You can make a backup of your current file to place it back after we have tried fixing your problem.
I ask you this because your header.txt file contains code which is not meant to be in the header.txt file. The header.txt file should only contain html code which is normally placed in the body section of a file.
So it should not contain a doctype declaration <!DOCTYPE ... dtd"> and no <html ... > or <head> ...</head> or <body> sections and tags. This results in a webpage which does not validate to the web standards and which can eventually cause problems.
The wrong header.txt file is probably not the problem, but I just want to eleminate it as a probable source of your problem.

Henrie

Re: so the security number keeps coming up as wrong

Posted: Mon Apr 23, 2012 11:38 pm
by larryfowler24
Hello,
I replaced the header....but that didn't fix it...

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 5:44 am
by Henrie
Like i said before, I did not really think it would. I just had to make sure it wasn't the problem

Let's hope Klemen got a brilliant idea, because I don't.

Henrie

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 2:29 pm
by Klemen
I'm 100% sure something is breaking your sessions. If it's not the gbook.php file then it must be the settings.php file.

Does the security image work if you upload the original settings.php file (clean download without touching/opening it)?

Also check inside your guestbook folder on the server if you have a file called "error_log" or something similar inside. If it is open it in Notepad and let us know what the last few lines say.

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 3:00 pm
by Henrie
Maybe the settings.php file was edited with a bad editor.
When i checked the gbook.php file with the w3c validator it mentioned that a utf-8 BOM was present. When I check now it is gone, so it must have been in the header.txt file.
Maybe that is also the problem with the settings.php file, that the editor larryfowler used to edit the settings added the utf-8 BOM.
I am sure though that it could be the cause of the breaking of the sessions.

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 4:27 pm
by Klemen
It's indeed the settings.php file - just checked and it does have BOM.

The header.txt couldn't be the problem (even if with BOM) because the header.txt file is included once all headers are already sent, but other includes (like settings.php) are included early on and the BOM causes HTTP headers to be sent even though GBook still needs other headers later on.

To not confuse Larry too much:

Uploading a clean settings.php file should fix the issue. Once you verify that use a plain text editor like Notepad to edit settings or if using some other editor make sure you don't save it as "utf-8 with byte order mark".

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 6:04 pm
by larryfowler24
So.....I tried adding the 'clean' settings.php and I got an error saying there was a write error....I changed permissions to 666 and it still wouldn't write to it.....
I did a search in the settings.php and I didn't see any BOM or UTF stuff....

I put my old 'settings.php, gbook.php, and header.txt' .............and now it works...........

Can you guys check it?
I will send beer money soon...

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 8:10 pm
by Henrie
No need to sent me any money as I could not fix your problem.
I still get the message "wrong security number" when trying to post a message.

btw, the guestbook does not need to write to the settings.php file, only read it.
On my site the gbook folder has chmod 777 and the settings.php file has chmod 644

And you can not search for the Byte Order Mark it is not shown by most file editors. Try notepad++ ( http://notepad-plus-plus.org/ ) as a file editor. It has a pull down menu named 'encoding' and when you choose it, it shows the current encoding of the file 'encode in UTF without BOM' , or 'encode in UTF' (this is with BOM), or any of the other encodings. With this menu option you can remove the BOM. Best option is to choose 'encode in ANSI'.

Greetings,
Henrie

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 8:25 pm
by larryfowler24
I am using PHP editor to view the php files....
so what is our next step?

Re: so the security number keeps coming up as wrong

Posted: Tue Apr 24, 2012 8:33 pm
by larryfowler24
uh oh...I tried changing the gbook folder to 777...and now its screwed up...

I guess I could do a new installation and save the old folder?