Re: javascript check

From: Date: Thu, 19 Oct 2000 15:14:52 +0000
Subject: Re: javascript check
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21173@lists.php.net to get a copy of this message
I'd use a redirect. Try putting the following in the <head> section: <head> <meta http-equiv="refresh" content="1; url=http://www.blah.com/yourfile.php"> <script language="JavaScript"> // if js is enabled, this will redirect.. location.href = "http://www.blah.com/yourfile.php?js=true"; </script> </head> Then something like this in yourfile.php: <?php if ($js) { // javascript enabled. }else{ // not enabled. } ?> SteveD ----- Original Message ----- From: <hennink@patrijs.max.nl> To: <joe@jWebMedia.com> Cc: "Jonatan Bagge" <jb@signal.uu.se>; <php-general@lists.php.net> Sent: Thursday, October 19, 2000 3:53 PM Subject: Re: [PHP] javascript check > well, > > I was hoping that I could detect that a user has turned off javascript. > If not, my program should give a warning that this page needs javascript. > Maybe there is a HTML solution for this problem??? > > Tijmen > > On Thu, 19 Oct 2000 joe@jWebMedia.com wrote: > > > While PHP can tell if you a certain browser is capable of JavaScipt it > > cannot tell you if Javascript is indeed turned on. The get_browser() > > function looks to a browscap.ini file on your server. It gets the > > HTTP_USER_AGENT into and checks it against the file and says, "yes, > > Netscape 4.5 has javascript support", but that's it. Whether or not its > > on is unknown. Put the browscap.ini file somewhere on your server, and > > in the php.ini file, point the browscap to that file. Do a $browser = > > get_browser(); > > if ($browser["javascript"]) { > > some code; > > } > > > > It should return true even if Javascript is turned off in your browser. > > Hope this helps, > > > > Joe > > > > > > > > -- > Customer: I'm running Windows '98 > Tech: Yes. > Customer: My computer isn't working now. > Tech: Yes, you said that. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#21173) next »