0

I need to check from server side if client machine is Javascript enabled or not.
Is it possible in PHP? If it is, how?

MarcoS
  • 17,323
  • 24
  • 96
  • 174
  • 1
    Ajax call to the server on page load. If the call happens, javascript is enabled. – arao6 Dec 16 '14 at 07:18
  • 1
    It'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
  • 1
    Why 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 Answers1

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