[PHP] Get the page where the script is loaded from.

Discussion in 'Web Design & Coding' started by Glaanieboy, Dec 31, 2003.

  1. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Is there any way for a PHP script to see where it is loaded from? For example, the script in my signature is loaded from a different server than NTFS.org, is there a function or something available in PHP that can tell the script it is loaded from NTFS.org?
     
  2. Henyman

    Henyman Secret Goat Fetish Political User

    psssst my providor isnt pol.com ;)
     
  3. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Looks like there are some bugs in it :lol: What is your provider then?
     
  4. Henyman

    Henyman Secret Goat Fetish Political User

    Freeserve Broadband, unless they use that instead......................


    *goes to see*
     
  5. Henyman

    Henyman Secret Goat Fetish Political User

    yeah my whois shows up as Henyman@*******.c5.dsl.pol.co.uk

    so it's right..........but not :p
     
  6. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I assume everyone connecting with Freeserve connects through pol.co.uk, so I shall hack up the script.
     
  7. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
  8. Henyman

    Henyman Secret Goat Fetish Political User

  9. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    pol.co.uk is actually the energis network whom freeserve use servers from. I'm sure that other ISP's also use the energis network. So your script was originally correct in suggesting that pol.co.uk was the ISP, as it's the network Heny is connecting via.

    With regards to the question, if I understood correctly, just use the referrer variable.
    PHP:
    $HTTP_SERVER_VARS['HTTP_REFERER'];
    http://uk2.php.net/reserved.variables
     
  10. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Oh, but be warned that some builds of IE do not send a referrer header, therefore you'll need a default "Don't know" value :)

    Also some internet security and firewall software will block it from being sent, again, possibly only in IE, but possibly also in third party browsers.
     
  11. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Thanks. *tries*
     
  12. GoNz0

    GoNz0 NTFS Stoner

    Messages:
    2,781
    Location:
    the year 2525
    i'm not using mozilla i use ie6 :p

    don't think you can do much about my isp it says btopenworld, but im btinternet, i have the feeling thats the way things are with that as i never see btinternet come up on any of those lil apps to tell us what we already know :)
     
  13. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    stupid bugs. I shall look at it later this evening.
     
  14. GoNz0

    GoNz0 NTFS Stoner

    Messages:
    2,781
    Location:
    the year 2525
    lol says ie 6 now :)
     
  15. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    recognises IE here no problem :)

    [​IMG]
     
  16. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Glad it works ok. I am in the process of making a service like Audio Tracker. Coming soon.
     
  17. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Wouldn't it be cooler if it said what music I was listening to? :D
    Good luck on that one. ;)
     
  18. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I am working on that, Zedric ;) I am currently building a script that should do just that. All you need is Winamp 2.x or higher (not 3) and music :)
     
  19. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    The script is done, I am now writing a guide on how to set up the DoSomething plugin.
    Does anyone know of other plugins like DoSomething, which can send out costumized URLs whenever a song changes? This is for people who use other players than Winamp.
     
  20. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    suppose you'd have to check the relevant site's for the players...

    Also you can grab my guide that I wrote over at X-Istence.com and alter it .. will save you time ;) :D