This is a discussion on Accessing a script on a remote server within the PHP Language forums, part of the PHP Programming Forums category; I have a script set up on one server which queries the mysql server there and creates html code with ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
"Spidah" <hamilton@eyehug.co.nz> wrote in message
news:<9dkgb.169997$JA5.4246124@news.xtra.co.nz>... > > 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. And it shouldn't. Including only works locally. Otherwise, anyone could use your code... > Is there a correct way to do this? Use the readfile() function: readfile ('http://remote_host.com/path/to/remote/script.php'); Cheers, NC |
|
|||
|
If your site supports it, have a look at the curl functions:
http://us2.php.net/manual/en/ref.curl.php > "Spidah" <hamilton@eyehug.co.nz> wrote in message > news:<9dkgb.169997$JA5.4246124@news.xtra.co.nz>... > 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 |