Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2002
    Location
    Arcadia, CA
    Posts
    148

    call a script from another script in PHP

    I just want to do something really simple, but I don't really know how (I'm using PHP).

    I want to call a script at another host to run silently without the user ever finding out.

    To be a bit more specific - I just want it for a simple counting script. For example on my main index.php page, I want to open http://www.somedomain.com/logging.php?x=referer and have the logging script just log the referer somewhere. I'm not quite sure how to call that script without making the index.php page actually go there.

    Thanks!

  2. #2
    Join Date
    Jan 2005
    Posts
    45
    I believe you just want to use include("url"); . Not sure exactly what you're asking, though.

  3. #3
    Join Date
    Jun 2002
    Location
    Arcadia, CA
    Posts
    148
    Perfect =)
    Thanks, I appreciate it. I knew it was simple.

  4. #4
    Join Date
    May 2005
    Location
    Roanoke, VA
    Posts
    36
    Keep in mind that some hosts disable the ability to do this, as as security measure.
    You cooin' with my bird?

  5. #5
    Join Date
    Jun 2004
    Location
    Digital Texas
    Posts
    55
    Even if thats a problem (it being disabled), theres a ob_get_contents, or something along those lines, It pulls the contents of a file and you can then execute from there...

    Ive used this a couple of times to pull someones newsposts (god bless newspro), cut them up, and format them into a nice little blog that fits into my websites scheme. Of course, I always gave credit to the news site & author

  6. #6
    Join Date
    May 2005
    Location
    Roanoke, VA
    Posts
    36
    Nyture: what I meant was that some hosts will disable the ability to open remote files (whether by turning off fopen_url or otherwise), period. You can still get some of the same effect with curl, but it's much harder to execute remote files.
    You cooin' with my bird?

  7. #7
    Join Date
    Jun 2002
    Location
    Arcadia, CA
    Posts
    148
    Thanks a lot everyone.

    Either way, it is my own server, so I get to do what I want with it =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •