470,848 Members | 1,321 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

How to invoke remote php file from php?

Hi, I have a local php file and I need to get info back from php file
on the server. How do I invoke remote a php? I can access this remote
php thru a simple url and it prints some info on the web page. How do I
get this info back to store as a variable in local php?

Regards,
Alex.

Jan 5 '06 #1
5 1354
Alex wrote:
Hi, I have a local php file and I need to get info back from php file
on the server. How do I invoke remote a php? I can access this remote
php thru a simple url and it prints some info on the web page. How do I
get this info back to store as a variable in local php?

Regards,
Alex.

See example 16-11 here:
http://www.php.net/manual/en/function.include.php
Jan 5 '06 #2
NC
Alex wrote:

I have a local php file and I need to get info back from php file
on the server. How do I invoke remote a php? I can access this remote
php thru a simple url and it prints some info on the web page. How do I
get this info back to store as a variable in local php?


$info = file_get_contents('http://remoteserver.com/script.php');

Cheers,
NC

Jan 5 '06 #3
Carl & NC,

Thank you very much!!! Both examples work great.

Jan 5 '06 #4
Not precisely sure what you mean, something simple like this might do
what you want:

$contents =
file_get_contents('http://www.site.com/alexs_page.php?param=1&id=2');

Jan 5 '06 #5
NC wrote:
Alex wrote:
I have a local php file and I need to get info back from php file
on the server. How do I invoke remote a php? I can access this remote
php thru a simple url and it prints some info on the web page. How do I
get this info back to store as a variable in local php?

$info = file_get_contents('http://remoteserver.com/script.php');

Cheers,
NC


Much cleaner than my suggestion.

Thanks,
Carl.
Jan 5 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ahmed Syed | last post: by
reply views Thread by Pawan Narula via DotNetMonster.com | last post: by
reply views Thread by RajeevSekar | last post: by
1 post views Thread by Chris Davoli | last post: by
reply views Thread by franz1975 | last post: by
reply views Thread by clteh9 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.