Not sure if javascript or php or any other code.. but please help.

Discussion in 'JavaScript' started by n00bl3t, Mar 23, 2013.

  1. #1
    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...
     
    n00bl3t, Mar 23, 2013 IP
  2. Gemba

    Gemba Member

    Messages:
    36
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    25
    #2
    I responded to your PHP post, but here's the javascript.
    if (document.referrer.indexOf("123.com") !== -1) {
    window.location = "http://example.com";
    }
    Code (markup):
    123.com is the referrer you're looking for and example.com is where they would get redirected to.
     
    Gemba, Mar 23, 2013 IP