[thelist] Testing for Javascript with PHP

s t e f notabene at members.evolt.org
Sat Oct 12 14:49:01 CDT 2002


<who="Liorean" when="22:00 11/10/02 +0200">
>I don't know of such a mechanism (on the other hand I don't know any php),
>but you could always put a script in the page, and set a session variable
>when such a file is requested. Then you can base your php output upon that
>variable.

Alternatively you could do something like that:
- set a cookie with javascript
- try to get the cookie on the next page with PHP

Of course it still doesn't help if people have disabled cookies.

(original idea came up after [was it] aardvark told us about this method to
build a database of screen resolutions: gathering screen width+height via
javascript, putting it in a cookie, and then catching the cookie
server-side for statistical purposes).

s t e f
http://nota-bene.org




More information about the thelist mailing list