Welcome to WebmasterWorld Guest from 107.20.104.161

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

pattern matching in refering url

     

oilman

11:55 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am trying to write a cookie (php) that sets a value based on the referrer string. ie: if user used the search phrase 'blue widgets' then value is set to one or if user used search phrase 'red widgets' then value is set to 2 and do on.

Little help? :)

andreasfriedrich

12:25 am on Mar 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something along these lines should do the trick:

if (preg_match [php.net]("'red'", $_SERVER['REFERER'])) {
setcookie [php.net]();
} else {
setcookie [php.net]();
}

Andreas

oilman

12:59 am on Mar 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks - I was playing around with preg_match earlier but didn't have the syntax right. I'll give it a whirl right away.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month