|
Posted by Jean Pion on 08/05/05 15:46
"Erwin Moller"
<since_humans_read_this_I_am_spammed_too_much@spamyourself.com> schreef in
bericht news:42f34aaf$0$11065$e4fe514c@news.xs4all.nl...
> 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.
>
Thanks Erwin,
that sounds fine,
Jean.
[Back to original message]
|