cookie detection with PHP browser detection script
giles
Status: New User - Welcome
Joined: 25 Mar 2008
Posts: 1
Reply Quote
Hi,

I'm trying out the PHP browser detection script techpatterns.com/downloads/php_browser_detection.php#php_full

The example on the above page returns the cookie state of the browser. I've tried to find an example of how this mght be achieved, but I can't find any clues. Am I missing something .. or is this unavailable in the free version? Can you help?

Thanks in advance
Giles
Back to top
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 594
Reply Quote
Yes, you are missing something:

Sounds like you are looking for the system information script called 'Your Computer' offered here, which is a sample front end use of the primary php browser detection functions.

Things like cookies are not handled by the primary browser detection script, the output on the computer information box uses a mixture of javascript and php to grab cookie support.

It is not possible with php to both set and test a cookie on the same page load, you can EITHER set it, or test it.

Javascript, however, can do this, it can set then test. So the your computer box script uses javascript cookies as well, for the setting of the cookie, if I remember right, and to read (get) if the cookie is set on the client browser.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours