Re: javascript check

From: Date: Thu, 19 Oct 2000 17:11:09 +0000
Subject: Re: javascript check
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21205@lists.php.net to get a copy of this message
I'm no javascript coder. But I think you should try using a small javascript that redirects you to the same page but with a variable set. <SCRIPT LANGUAGE="JavaScript"><!-- document.write(' <META HTTP-EQUIV="refresh" content="1;URL=page.php3?js=1"> '); //--></SCRIPT> If it isnt't javascript enabled. The it won't redirect... > 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

« previous php.general (#21205) next »