Accessing a script on a remote server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spidah

    #1

    Accessing a script on a remote server

    I have a script set up on one server which queries the mysql server there
    and creates html code with the results. How do I access this and include the
    results in a page on another server? Simply including it doesn't work.

    Is there a correct way to do this?

    Thanks

    Hamilton


  • Nikolai Chuvakhin

    #2
    Re: Accessing a script on a remote server

    "Spidah" <hamilton@eyehu g.co.nz> wrote in message
    news:<9dkgb.169 997$JA5.4246124 @news.xtra.co.n z>...[color=blue]
    >
    > I have a script set up on one server which queries the mysql
    > server there and creates html code with the results. How do
    > I access this and include the results in a page on another
    > server? Simply including it doesn't work.[/color]

    And it shouldn't. Including only works locally. Otherwise, anyone
    could use your code...
    [color=blue]
    > Is there a correct way to do this?[/color]

    Use the readfile() function:

    readfile ('http://remote_host.com/path/to/remote/script.php');

    Cheers,
    NC

    Comment

    • Wes Bailey

      #3
      Re: Accessing a script on a remote server

      If your site supports it, have a look at the curl functions:


      [color=blue]
      > "Spidah" <hamilton@eyehu g.co.nz> wrote in message
      > news:<9dkgb.169 997$JA5.4246124 @news.xtra.co.n z>...
      > I have a script set up on one server which queries the mysql server there
      > and creates html code with the results. How do I access this and include the
      > results in a page on another server? Simply including it doesn't work.
      >
      > Is there a correct way to do this?
      >
      > Thanks
      >
      > Hamilton[/color]

      Comment

      Working...