hello, Does anybody give me an idea how to make this happen? I know about this little script: <metahttp-equiv="refresh"content="10;url=http://example.com"/> but I want to add a little script before this is loaded. I only want the url to refresh IF the referrer is from www.123.com.. so this is the scenario: if visitor A goes into www.xyz.com and he/she is coming from search engine the refresh code above will not load... if visitor B goes into www.xyz.com and he/she is coming from www.123.com the refresh/reload code above will kick in.. Any help is very much appreciated...
You can use the $_SERVER['HTTP_REFERER'] variable if (stripos($_SERVER['HTTP_REFERER'], "123.com")) { header('Location: http://redirect.com'); } Code (markup): redirect.com being the place you want to redirect to and 123.com being the referrer you're looking for.
Hi Gemba, I think the code you have create makes "DIRECT" refresh/reload of the page? I wanted the 10seconds wait time before it reload/refresh... is this possible?
Yeah, just change the 2nd line to echo '<metahttp-equiv="refresh"content="10;url=http://example.com"/>';
for example: Scenario ONE: visitor A came from xyz.com (REFERER) and went to 123.com/home.html now that xyz.com is the referer.... I want the visitor A to see 123.com/home.html then after "X" seconds Visitor A gets redirected to 123.com/latest_news.html Scenario TWO: Visitor B came from unknownreferer.com (NOT WANTED REFERER) and went to 123.com/home.html nothing will happen or NO redirect/reload/refresh will happen to VISITOR B.... Visitor B can either leave the site or browse or do whatever...
Hi Gemba, I was not successful in implementing the code. However, I found this: http://wordpress.org/extend/plugins/referrer-detector/screenshots/ I wanted something like this, but that plugin was only able to post welcome messages... what I wanted is to execute a script if the url is from one of the list I create... Anyway thank you so much for giving me some information.
Try to add \(back slash) before "(quote) e.g. if (stripos($_SERVER['HTTP_REFERER'], "123.com")) { echo '<metahttp-equiv=\"refresh\"content=\"10;url=http://example.com\"/>'; } Hope this will help!