You are here: Re: Servers side JavaScript detection in PHP4 « PHP Programming Language « IT news, forums, messages
Re: Servers side JavaScript detection in PHP4

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация