RE: 2 questions: Search in array and detect JS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
<script language="javascript">
<!--
     location.href = '/url/for/ajax/page.php';
-->
</script>
[/snip]

My only concern with this method is that it constitutes an exit trap... For
example, if a user connects to your index page from, say, Google they will
be redirected over to your Ajax page... All good, except if they click Back
to return to the SE page they will immediately bounce back to your Ajax page

Something to consider might be:

<noscript>
Sorry! This page requires Javascript to function properly! Please enable it
or get a decent browser
</noscript>

<!-- Normal page functions -->

I haven't tested it so there is a chance it's fiction :)

Of course, if web standards aren't a concern it makes no difference

HTH

Dan

 
-------------------
http://chrome.me.uk
 
-----Original Message-----
From: Ryan A [mailto:Ryan@xxxxxxx] 
Sent: 15 April 2006 14:26
To: php
Cc: "Stut"
Subject: Re:  2 questions: Search in array and detect JS

Hey Stut,
Thanks for replying.

-------------------


The way I do this is to serve the 'notmal page' first, but with the
following snippet of JS in it...

<script language="javascript">
<!--
     location.href = '/url/for/ajax/page.php';
-->
</script>----------------------Makes sense and pretty easy, this was
suggested a while back, since you have supported itI think I'll start using
this method.------------------- You should be able to craft some combination
of array_walk and a custom
function that checks each element with stristr to do what you need.
-------------Actually, I solved this thanks to Richard from the list who
suggested strpos, a function I had never usedbefore ( Tedd from the list
gave me the same suggestion as you to use stristr, I didnt want to use
stristr as its a bit expensive esp with a really large array) the problem I
ran into was that strpos is a php5 function....but reading the user
contributed articles on strpos at thephp site I got the code that does
exactly that in 2-3 linesCheers!

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


__________ NOD32 1.1490 (20060415) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux