Help me code this please

Discussion in 'PHP' started by rymdoll, Sep 7, 2008.

  1. #1
    i am trying to make a small script with my little php knowledge.
    i want to implement a small piece of code on the script, so it sends the URL of the site that is running it to another site, then the receiving site will store it on a database.
    how to do this please?
     
    rymdoll, Sep 7, 2008 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think its quite safe to say you need to provide a lot more information than this, and perhaps give an example. are the two sites both related, ie do you own both, and can have scripts on both? if not, which of the two is yours, the first or the latter etc etc
     
    JAY6390, Sep 7, 2008 IP
  3. rymdoll

    rymdoll Banned

    Messages:
    182
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i own the script that i will sell
    i want the sites where the script is installed to call my owned site and give him the url they are running on.
    i wanna do a callback, because i am unable to make a licensing system
    so better for me to stock urls, time to make another script that checks licenses for domains
     
    rymdoll, Sep 7, 2008 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    oh i see. well the easiest way is to send the URL via a simple GET statement in your script with the $_SERVER['HTTP_HOST'] using something like
    file_get_contents('http://www.yourdomain.com/yourscript.php?url='.urlencode($_SERVER['HTTP_HOST']));
    PHP:
    Then have yourscript.php get the url from $_GET['url'] and urldecode() it
     
    JAY6390, Sep 7, 2008 IP
    rymdoll likes this.
  5. rymdoll

    rymdoll Banned

    Messages:
    182
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    got the first part thanks, then how to urldecode() , i am a noob :)
    by the way reputation added , thank u
     
    rymdoll, Sep 7, 2008 IP
  6. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well for example,
    $url = urldecode($_GET['url']);
    PHP:
     
    JAY6390, Sep 7, 2008 IP