Forum Moderators: coopster

Message Too Old, No Replies

problem with stristr($_SERVER['HTTP_REFERER']

         

hermes

1:12 am on Nov 24, 2005 (gmt 0)

10+ Year Member



consider if your referrer is:

www.google.com/uihiuhiuhwhdjbiuwhibd_HELLO_dfhuihuih.html

Now with this referrer - this syntax works fine:

stristr($_SERVER['HTTP_REFERER'], 'google')

BUT this does not:

stristr($_SERVER['HTTP_REFERER'], 'HELLO')

It seems this this syntax can only look at the actual domain of the referrer term. It cannot look at after the /

Am I right on this? It is what I am finding with my experience. Is there any way that I can look at the whole referrer term? Not just the domain component?

hermes

2:15 pm on Nov 24, 2005 (gmt 0)

10+ Year Member



Would be so grateful to anyone that can help. Is my Q clear? Just wondering why this thread hasn't taken off. Maybe my Q is not written in an understandable way?

coopster

3:03 pm on Nov 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What are you attempting to do with it? Runs fine for me ...
$string = 'www.google.com/uihiuhiuhwhdjbiuwhibd_HELLO_dfhuihuih.html'; 
echo stristr($string, 'google') . "\n";
echo stristr($string, 'HELLO') . "\n";
// prints:
google.com/uihiuhiuhwhdjbiuwhibd_HELLO_dfhuihuih.html
HELLO_dfhuihuih.html