[PHP] Intermittent etwork connection errors with apache. Restarting apache temporarily fixes the problem. PHP or apache problem?
Hi - At the top of my php scripts, I have code to connect to our ldap server, in order for the scripts to make ldap requests. I don't have any disconnect call in my code. Lately I have noticed that the apache server will get into a state where connection requests will occasionally fail. When I refresh the page, the connection almost always succeeds on the 2nd attempt. If I restart the apache server, the problem totally goes away for a long period of time. So I assume that somewhere, something is causing connections to stay opened when the script ends, rather than automatically closing them. This error occurs with other types of network connections that the script makes (besides ldap), so it's not an ldap issue. How does Apache automatically close connections when the script ends? Is it possible that connections are being left opened? Is there any way to debug the problem, i.e. to see if connections are left opened in some way? I'm running redhat 5, httpd-2.2.3-31.el5_4.2 php-5.1.6-23.2.el5_3 Thanks. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Distinguishing between a mouse click and a refresh?
Is there any way for PHP to know whether it is being called due to a browser refresh versus a mouse click? I think the answer is no but I just want to be sure. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Distinguishing between a mouse click and a refresh?
Hi - Thanks! This is the solution I actually realized myself last night, after many hours of looking at the other solutions and finding problems with them. Thanks to everyone who responded! - Mark Richard Lynch wrote: On Mon, December 4, 2006 3:03 pm, Mark London wrote: Is there any way for PHP to know whether it is being called due to a browser refresh versus a mouse click? I think the answer is no but I just want to be sure. Thanks. You could embed a random token in all your links and input forms, and if they re-use a token, then you know they are re-loading something they have seen at some time in the past.