|  | Posted by Jean Pion on 08/05/05 18:35 
"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;
 >
 >
 There is a drawback to this, being that a button is visible, and one should
 click it.
 So after some browsing I found the following suggestion to solve this:
 
 
 <form action="some_url" name="jscheckform" method="post">
 <input type="hidden" name="jsenabled" value="N">
 </form>
 
 <script type="text/javascript">
 <!--
 document.forms.jscheckform.jsenabled.value="Y";
 document.forms.jscheckform.submit();
 //-->
 </script>
 
 So, nothing is visible and no need to press any button.
 My problem is what to use for action parameter.
 I dont wan't to show another page, can I use the same url?
 
 Another is that I currently don't accept post to this page...
 
 Tia, Jean.
 [Back to original message] |