You already have a message waiting approval!

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
wolf
Posts: 5
Joined: Wed May 12, 2010 6:36 pm

You already have a message waiting approval!

Post by wolf »

Script URL: http://wolfgang.vacau.com/~wolf/gbook/gbook.php
Version of script: 1.7
Hosting company: 000webhost.com
URL of phpinfo.php: http://wolfgang.vacau.com/temp/phpinfo.php
URL of session_test.php: http://wolfgang.vacau.com/temp/session_test.php
What terms did you try when SEARCHING for a solution:
You already have a message waiting approval!

Write your message below:

NOTE ABOUT URL's: all URL's are password protected, with user php and password php.

When someone tries to access the guestbook after having made a post, they get the following message:

Error
You already have a message waiting approval!

This happens even after they close the browser, log out, shut down, and try again (as far as I can tell). I haven't gotten an email with the approve/deny, and there is no file pending approval in the apptmp folder. The readme is no help, and I can't find any post RE this problem. I'm not that good with PHP (especially if I didn't write it), so I can't really read the script and figure out how to fix this. Perhaps the script uses cookies?...
Thanks in advance for your help.
:?:
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

I was able to submit a message without poblems and don't get any error messages.
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
wolf
Posts: 5
Joined: Wed May 12, 2010 6:36 pm

Still not working

Post by wolf »

I tried clearing all browsing data (cookies, etc.), and still get this message.
As I stated before, I cannot find anywhere that the guestbook would store this data.
If it helps, I am using the Google Chrome web browser. I rejected your test post; try posting again. I suspect you may get the message.
This problem is driving me crazy!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I have also posted a message in your guestbook.
I used Google Chrome 4.1

What I did.
  1. Posted a message.
  2. Tried to post another message. Got Error message that i am only allowed to post one message per session.
  3. Closed Google Chrome and restarted. Tried to post another message, I get the error You already have a message waiting approval!
Now let's see what happens when you reject or approve the message.

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

Post by Klemen »

I just tried posting again - no problems.

The "You already have a message waiting approval" error is tied to an IP address so if you post a message from an IP address you won't be able to post a new one until the old one (posted from the same IP) isn't approved or rejected.
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
wolf
Posts: 5
Joined: Wed May 12, 2010 6:36 pm

Disable once_per_session

Post by wolf »

The problem is that I have a whole bunch of people connecting from the same IP address (most of the people who connect to my site, including me). Thus, when one person signs the guestbook, everyone is blocked. I changed my settings file to read:

Code: Select all

/* Prevent multiple submissions in the same session? 1 = YES, 0 = NO */
$settings['one_per_session']=0;
However, I still get the message. How do I reset the IP addresses so it stops doing this?? [/code]
wolf
Posts: 5
Joined: Wed May 12, 2010 6:36 pm

Problem solved!

Post by wolf »

Never mind. I fixed the problem.
There was an old test post hanging around, which was never rejected. This caused the guestbook to block my IP address. I just rejected the post, and the problem cleared right up. Thank you for your quick response!
:D
wolf
Posts: 5
Joined: Wed May 12, 2010 6:36 pm

Fix found...

Post by wolf »

Yesterday, I had three people tell me within 20 minutes that my guestbook was broken. Same IP address, etc. as before. So, I did some poking around in the code and discovered that the

Code: Select all

$settings['one_per_session']
setting does not have an effect, as the IP address is used anyway. However, I fixed the problem by changing

Code: Select all

$tmp = md5($_SERVER['REMOTE_ADDR'].$settings['filter_sum']);
to

Code: Select all

$tmp = md5($_SERVER['REMOTE_ADDR'].$settings['filter_sum'].date('Uu'));
This appends the seconds and milliseconds since the Unix epoch onto the end. Since it is very unlikely that two people will submit entries at the same millisecond, this insures unique filenames.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

$settings['one_per_session'] is used so that visitors can only post one message per browser session. And this works as it should.

The $settings['one_per_session'] has nothing to do with the manual approval function. These are two entirely different functions.
By changing the code, you have changed that someone can have more than one message waiting for approval instead of only one.

If you would set $settings['one_per_session']=1; your visitors can still only post one message without closing their browser in between.

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