I need to check from server side if client machine is Javascript enabled or not.
Is it possible in PHP? If it is, how?
Asked
Active
Viewed 1,200 times
0

MarcoS
- 17,323
- 24
- 96
- 174

Bikash Paul
- 15
- 8
-
1Ajax call to the server on page load. If the call happens, javascript is enabled. – arao6 Dec 16 '14 at 07:18
-
1It's possible using AJAX as arao wrote, I have another question. Why you need to know that on server? I mean you what to solve something what should be solved better without this knowledge. – pavel Dec 16 '14 at 07:19
-
You can use this [solution](http://stackoverflow.com/a/9503382/473016) – anpsmn Dec 16 '14 at 07:20
-
1Why in earth do you want to do this with PHP ? Use javascript itself, or even `HTML` `noscript` tag – Alireza Fallah Dec 16 '14 at 07:21
1 Answers
0
Try using ajax
from client, if it works then javascript is enabled
With jQuery you can simply:
$.ajax({
url: "/checkjavascript.php"
});
if your php receives call from client then Javascript is enabled in the client

marc_s
- 732,580
- 175
- 1,330
- 1,459

asdf_enel_hak
- 7,474
- 5
- 42
- 84