Nothing tested, just off the top of my head. The single most reliable way to
do that would be to have a page that runs JavaScript.

For instance, if the JavaScript executes, it redirects to your JavaScript
enabled page, if not, the page does a refresh to a non JavaScript enabled
page.

<html><head><title>tester></title>
<script language='JavaScript'>
    window.location('http://some.javascript.enabled.page');
</script>
<meta http-equiv=refresh content='5;url=http://some.nonjavascripting.page'>
</head>

The trick would be a matter of timing, the JavaScript must successfully
execute before the timer runs out on the refresh tag. You can of course get
much fancier, changing the redirect based on the client information that PHP
has available. PHP could effectively write the JavaScript to the page based
on the known capabilities of the client. For instance the refresh tag is
generally useless for browsers like Lynx, as is the JavaScript.

Alternatively, you could (just supposing now...) have the first page do an
instant refresh, using JavaScript to trigger a value in PHP. If the value is
set, JavaScript was enabled, if it is not, JavaScript was turned off.

But I've not tried it.

DAve

--
Dave Goodrich
Director of Interface Development
Reality Based Learning Company
9521 NE Willows Road, Suite 100
Redmond, WA 98052 
Toll Free 1-877-869-6603 ext. 237
Fax (425) 558-5655 
[EMAIL PROTECTED] 
http://www.rblc.com


> From: Jochen Kächelin <[EMAIL PROTECTED]>
> Reply-To: <[EMAIL PROTECTED]>
> Date: Sun, 25 Feb 2001 05:37:17 +0100
> To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
> Subject: [PHP] Detecting JavaScript
> 
> Who can give me a PHP-Script to
> detect if JavaScript is enabled?
> 
> It should work with both, IE and NN!
> 
> thanks
> 
> --
> Ihr WEBberater
> Stuttgarter Str.3, D-73033 Göppingen
> Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> http://www.wa-p.de ** mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to