Accessing a script on a remote server

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-06-2003
Spidah
 
Posts: n/a
Default 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


Reply With Quote
  #2 (permalink)  
Old 10-07-2003
Nikolai Chuvakhin
 
Posts: n/a
Default Re: Accessing a script on a remote server

"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
Reply With Quote
  #3 (permalink)  
Old 10-07-2003
Wes Bailey
 
Posts: n/a
Default Re: Accessing a script on a remote server

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:26 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0