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.

Second question. Unless I don't understand the problem, simply use a loop and stristr().

See; http://www.weberdev.com/stristr

HTH's

tedd

---
At 7:24 PM +0200 4/14/06, Ryan A wrote:
Hi,
Like the subject says; I have two questions:

1) Is it possible to detect JavaScript via php... and yes I do know that JS
is client side while PHP is server...but how else to do it?
The reason I ask is before serving an AJAX page I would like to make sure JS
is enabled, if not, serve the other "normal page"... I am sure I am not the
first person to come accross this little problem, how did you solve it?

I have seen some suggestions on google like having a hidden form field  and
using  js to put a value in it, if it exists when the form is sent then JS
is on..if not, its not... but that method is not the best in an AJAX
situation...right?


2) How can I search in an array for a particular word?

eg: in an array "movie" I have this kind of data:
movie_name=> some movie
cast=> Jim Carrey, Richard Pryor, Eddie Murphy

I want to search on either "Richard" or "Richard Pryor" (must be case
insensitive too)
something like a SELECT with a LIKE %% statement

I have been fooling around with in_array() but not getting anywhere
fast..... am I on the right track?
Links, code examples or advise would be as always....appreciated.

Thanks,
Ryan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
--------------------------------------------------------------------------------
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to