I am working on a mobile mail app where I have created 2 versions of the app, the one is for javascript disabled devices. I want to redirect my users (if they visit the app using a javascript disabled device) to the non-js version of my site.
How can I know if the device is javascript disabled from server side?
I tested the following code on a javascript disabled device, instead of printing "Javascript is not enabled", It is returning empty .
$x="<script> document.write('hello world');</script>";
if(empty($x)) {
echo "Javascript not enabled";
}
Is there something wrong with the code?