Hello Guys,
In php ,how do I know weather javascript is enabled or not?
Thanks in adv,
| SitePoint Sponsor |



Hello Guys,
In php ,how do I know weather javascript is enabled or not?
Thanks in adv,
Barbara

Simply put, you don't. What is the reason for you needing to know if JavaScript is enabled.
Kayzio - We don't hesitate, we accelerate.
Well, maybe you could.
Write some javascript to set a variable to some value. With PHP check if that variable is set to the value it should be, or not.

Chousho that wouldn't work b/c PHP executes before JavaScript.
Kayzio - We don't hesitate, we accelerate.
As i had read in some internet page but i have not tested it yet if you could learn something from the following statement:
There was nothing more to read. If you can find some idea from above statement, please let me know too.the only way I know of is to set a test cookie, then reload the page (or go to a new one) and test to see if the cookie was set.
i.e. set the cookie when user goes to login form and on submission check if it was set.
Good luck.

If you create a cookie in Javascript you can read it in PHP. If the cookie is set then Javascript is enabled. You can find here how to read and write cookies in Javascript.



Hello Guys,
here is the link to check the javascript is enabled or not.
check javascript enabled or not
Thanks to all for replies.
Barbara
Bookmarks