Paying 10$ for a VERY easy script.

Discussion in 'Programming' started by getatune, Jun 23, 2008.

  1. #1
    Could someone make me a script that will check what the referring url and if its not the refereeing url i wanted then it will show a error message instead of the site.
    MUST BE EASY TO EDIT AND NOT ENCODED
    price i pay: 10$
     
    getatune, Jun 23, 2008 IP
  2. NetworkTown.Net

    NetworkTown.Net Well-Known Member

    Messages:
    2,022
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    165
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    PM me ill do it now.
     
    NetworkTown.Net, Jun 23, 2008 IP
  3. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    <?php
    
    // Ref. site
    $ref = getenv("HTTP_REFERER"); 
    
    // site you want to test
    $url = "http://www.google.com";
    
    // the test ?
    
    // you can add more test to see if the url is with or without www
    
    if($ref != $url) {
         echo "Error Msg";
      }
      
      else { echo " show something else ";}
      
    ?>   
    PHP:
    send payment to my paypal :D
     
    commandos, Jun 23, 2008 IP
  4. lastMinutes

    lastMinutes Peon

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    #!/usr/bin/perl -w-T
    # The above is the path to the perl interpreter, modify to match yours!!!
    # Requires at least perl 5
    
    use CGI qw/:standard/;
    
    # URL of referRer
    my $ref = $ENV{HTTP_REFERER} || 'Unknown';
    
    # The referRer you want?
    my $wanted_ref = 'http://Somewhere/Dir/File.ext';
    
    # The URL you want to show IF the referRer is OK?
    my $url = 'http://MyDomain/MyDir/MyFile.ext';
    
    # Check if it's the referRer you want
    unless ($ref eq $wanted_ref) {
    print header;
    print qq/ERROR MESSAGE IN PLAIN-TEXT OR <code>HTML<\/code> HERE/;
    print qq/\n/;
    } else {
    print redirect($url);
    }
    
    exit;
    Code (markup):
    Wonder how to use it? :p
     
    lastMinutes, Jun 24, 2008 IP
  5. NetworkTown.Net

    NetworkTown.Net Well-Known Member

    Messages:
    2,022
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    165
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    This job has already been done by me.
     
    NetworkTown.Net, Jun 24, 2008 IP
  6. lastMinutes

    lastMinutes Peon

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    Okk. :D Just an idea, heh.
     
    lastMinutes, Jun 24, 2008 IP
  7. lastMinutes

    lastMinutes Peon

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    So that others won't need to invest $10 in a future? :p
     
    lastMinutes, Jun 24, 2008 IP