NYCPHP Meetup

NYPHP.org

[nycphp-talk] Remote php call

y2rob at aol.com y2rob at aol.com
Tue Mar 24 13:42:31 EDT 2009


 yeah i think curl is probably the best way.  plus i'm not sure if you have control over the service your calling, but if you do you can make it only reply to post requests, set authentification to the post request and other stuff to prevent malicious attacks.  there are options for ssl authentification, i had to use curl for a wsdl with user authentification and  just recently i created a quick curl call to a ruby webservice i created.  it's quick, easy and gets the job done.

~rob

-----Original Message-----
From: Brent Baisley <brenttech at gmail.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Sent: Tue, 24 Mar 2009 12:47 pm
Subject: Re: [nycphp-talk] Remote php call










Curl is the better way to go, but if you just need to hit a page on
another server you can use
file_get_contents("http://domain.com/script.php?param=a");

file_get_contents doesn't handle errors, failures, redirects,
timeouts, etc. very well, which is why curl is better. But in a pinch,
file_get_contents works.

Brent

2009/3/23 Michele Waldman <mmwaldman at nyc.rr.com>:
> Sorry for this posting.  I may seem lazy but everyone wants me to do
> everything right now and my daughter had 104 fever today.
>
>
>
> I’m pressed for time and I’ve got a baby to tend to right now.
>
>
>
> If I want to call a remote php script from a php file in a different
> domain?  Curl it?
>
>
>
> Michele
>
>
>
> _______________________________________________
> New York PHP User Group Community Talk Maili
ng List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/show_participation.php
>
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090324/cba9caf4/attachment.html>


More information about the talk mailing list