so the security number keeps coming up as wrong

Dr. GBooky is here to help you with your guestbook problems ...
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

so the security number keeps coming up as wrong

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

Re: so the security number keeps coming up as wrong

Post 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
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.
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

Re: so the security number keeps coming up as wrong

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

Re: so the security number keeps coming up as wrong

Post 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.
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
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

Re: so the security number keeps coming up as wrong

Post by larryfowler24 »

Hello,
I uploaded a fresh gbook.php......
It didn't fix it.....
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: so the security number keeps coming up as wrong

Post 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
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.
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

Re: so the security number keeps coming up as wrong

Post by larryfowler24 »

Hello,
I replaced the header....but that didn't fix it...
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: so the security number keeps coming up as wrong

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

Re: so the security number keeps coming up as wrong

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

Re: so the security number keeps coming up as wrong

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

Re: so the security number keeps coming up as wrong

Post 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".
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
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

Re: so the security number keeps coming up as wrong

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

Re: so the security number keeps coming up as wrong

Post 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
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.
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

Re: so the security number keeps coming up as wrong

Post by larryfowler24 »

I am using PHP editor to view the php files....
so what is our next step?
larryfowler24
Posts: 10
Joined: Mon Mar 19, 2012 5:04 pm

Re: so the security number keeps coming up as wrong

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