Need quick Javascript help

Discussion in 'JavaScript' started by dhuang90, Dec 16, 2010.

  1. #1
    So basically some guy ripped my site and he happened to copy my code which I was using to track the hits:

    <script src="http://site.com/landing.php?lpip=8297" type="text/javascript"></script>

    I'm currently using that code on another page to track visitors, but I would like to fuck this guy and have his site redirect.

    How is it possible for me to do this? $15-20 to the first person who can tell me how this can be done and code it for me.

    For example, if hissite.com has the code, I want this script to somehow detect his url, and run a script from site.com/script.php, but if its any other site but hissite.com, then it will run like normal.

    Send me a PM with your AIM/MSN.
     
    dhuang90, Dec 16, 2010 IP
  2. dhuang90

    dhuang90 Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Edit: we can also make it track the "lpip=8297" so if it senses that then it will pull the outside script.
     
    dhuang90, Dec 16, 2010 IP
  3. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #3
    
    <?php
        if(strpos($_SERVER['HTTP_REFERER'],'his-domain.com') !== false)
        {
            include('script.php');
        } else {
            //the normal behaviour
        }
    ?>
    
    PHP:
     
    tvoodoo, Dec 16, 2010 IP
  4. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #4
    javascript you could include to redirect
    
    switch(window.location.hostname ){ // check domain name
    case "hisdomain.com":window.location="http://someplace.com"; //redirect to wherever
    break;
    }
    
    Code (markup):
     
    shofstetter, Dec 18, 2010 IP
  5. inblues

    inblues Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    javascript is open source. Everyone can access and copy the code.
     
    inblues, Dec 28, 2010 IP
  6. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #6
    Just because you can view the code does not make it "open Source". The author of the code retains all rights unless explicitly defined in a distributed license. Furthermore if his page contains a copyright, the act of copying the code is also copyright infringement and a violation of the Digital Millennium Copyright ACT.
     
    shofstetter, Dec 28, 2010 IP
  7. inblues

    inblues Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi shofstetter, thanks for the correction.
     
    inblues, Dec 28, 2010 IP