|
Posted by Erwin Moller on 08/05/05 14:17
Jean Pion wrote:
> Dear readers,
>
> Is there somewhere, maybe $_SESSION vars?, where my PHP knows that
> JavaScript is enabled on the clients webbrowser.
> I uses some JavaScript but would like to add workaround in case the
> browser doesn't. Suggestions would be appreceated.
>
> Tia Jean.
Hi,
You cannot get that information from SESSION vars.
SESSION vars ONLY contains information you put into it.
Also the POST or GET will not help.
You can easily check that in another way.
Try something like this:
[on the startpage where you want to detect Javascript]
<form action="jscheck.php" name="jscheckform" method="post">
<input type="hidden" name="jsenabled" value="N">
<input type="submit" value="continue">
</form>
<script type="text/javascript">
document.forms.jscheckform.jsenabled.value="Y";
</script>
Now on the page jscheck.php you just retrieve the value of jsenabled:
$jsenabled=$_POST["jsenabled"];
// and maybe store it in a session for futher reference
$_SESSION["jsenabled"] = $jsenabled;
Hope that helps.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|