Re: 2 questions: Search in array and detect JS

From: Date: Fri, 14 Apr 2006 17:47:07 +0000
Subject: Re: 2 questions: Search in array and detect JS
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-234007@lists.php.net to get a copy of this message
On Fri, 2006-04-14 at 13:34, tedd wrote: > Ryan: > > First question. Technically no, you can't detect js from php. > > However, I read where one can detect if a user has cookies on by > sending a cookie and then reading it back. And considering that you > can send a cookie via js, you could do that. However, that would mean > that the user had to have both js and cookies on. It is probably a better to approach this backwards. So load the non JS page, and within it detect if javascript is enabled, in which case perform a javascript based redirect to the Ajax enabled page. > Second question. Unless I don't understand the problem, simply use a > loop and stristr(). stripos() is a better candidate since you are only looking for the string and it skips the extra processing of stristr(). Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#234007) next »