How to get a remote Url?...

Discussion in 'PHP' started by talle, Jul 10, 2007.

  1. #1
    talle, Jul 10, 2007 IP
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #2
    that makes like no sense. i mean, if you're addressing the script on host2 then obviously you know where it is.
     
    ansi, Jul 10, 2007 IP
  3. talle

    talle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No, this cript can be called by any webmaster from any anonymous site.
     
    talle, Jul 10, 2007 IP
  4. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #4
    something like $_SERVER['HTTP_REFERER'] ??
     
    ansi, Jul 10, 2007 IP
  5. Bartuc

    Bartuc Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #5
    no matter where your file is. it will work always where it is included. so, if you need variable from mysql, you'll need to authorize your otherdomain.com to connect mysql on mydomainn.com.

    if it is not, include all your files via url.
     
    Bartuc, Jul 10, 2007 IP
  6. talle

    talle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Others superglobal variables work fine, but this don't work.
     
    talle, Jul 11, 2007 IP
  7. 4GU.RU

    4GU.RU Member

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    Work , simple $_SERVER['HTTP_REFERER'] = null
     
    4GU.RU, Jul 12, 2007 IP
  8. talle

    talle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Don't work.:(
     
    talle, Jul 12, 2007 IP
  9. Hade

    Hade Active Member

    Messages:
    701
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    90
    #9
    Hade, Jul 12, 2007 IP
  10. talle

    talle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Somebody, from any random page can call to my script with an include. My script must know the URL from it has been called.
     
    talle, Jul 13, 2007 IP
  11. Im The ONE

    Im The ONE Peon

    Messages:
    800
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Check Logs from Cpanel :p
     
    Im The ONE, Jul 13, 2007 IP
  12. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Put the following code in a file:

    
    <pre>
    <?php
    print_r($_SERVER);
    ?>
    </pre>
    
    PHP:
    Do you see [HTTP_REFERER]?
     
    MMJ, Jul 13, 2007 IP
  13. Hade

    Hade Active Member

    Messages:
    701
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    90
    #13
    I stand by my original post as I believe it solves this!

    include:

    www.host.com/script.php?val=[calling host URL]


    The script can get the calling host name using $_GET['val']
     
    Hade, Jul 14, 2007 IP
  14. talle

    talle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I retake the subject because not yet I have found the solution.

    In the network, there are many services that placing a code in our page show an PageRank button indicator. Well, these services work placing only a code similar to this:

    <img src="http://www.domain-of-the-script.com/pr.php">
    Code (markup):
    It's clear that script takes, of some way, our URL to give back the PR indicator pertaining to the page where we have placed the code. Well, that I would like to know, how script is able to take our URL?.

    (Excuse me by my English language)
     
    talle, Jul 19, 2007 IP
  15. Hade

    Hade Active Member

    Messages:
    701
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    90
    #15

    Yes, my idea solves this!

    Try this:


    <img src="http://www.domain-of-the-script.com/pr.php?url=www.callingurl.com">
    Code (markup):
    (replace www.callingurl.com with the URL of the server calling the script.)


    And access $_GET['url'] within the script. It contains the calling URL!
     
    Hade, Jul 20, 2007 IP
  16. talle

    talle Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    That solution already knew it. I would like to know the other:

    <img src="http://www.domain-of-the-script.com/pr.php">
    Code (markup):
    Thanks.
     
    talle, Jul 20, 2007 IP