PHP equivalent to XMLHtttpRequest functions
PHP equivalent to XMLHtttpRequest functions
am 30.12.2007 23:09:02 von Edward Hass
Is there a PHP equivalent to the JavaScript XMLHttpRequest function:
.......
myrequest.open('POST', url, true);
........
myrequest.send(data);
In other words, I'd like to get data from another web page that needs to
receive input via the POST method.
Thanks,
Edward Hass
Re: PHP equivalent to XMLHtttpRequest functions
am 30.12.2007 23:39:35 von Jerry Stuckle
Edward Hass wrote:
> Is there a PHP equivalent to the JavaScript XMLHttpRequest function:
> ......
> myrequest.open('POST', url, true);
> .......
> myrequest.send(data);
>
> In other words, I'd like to get data from another web page that needs to
> receive input via the POST method.
>
> Thanks,
> Edward Hass
>
>
>
Check out the cURL functions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: PHP equivalent to XMLHtttpRequest functions
am 31.12.2007 01:02:46 von Manuel Lemos
Hello,
on 12/30/2007 08:09 PM Edward Hass said the following:
> Is there a PHP equivalent to the JavaScript XMLHttpRequest function:
> ......
> myrequest.open('POST', url, true);
> .......
> myrequest.send(data);
>
> In other words, I'd like to get data from another web page that needs to
> receive input via the POST method.
You may want to take a look at this popular HTTP client class:
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Re: PHP equivalent to XMLHtttpRequest functions
am 01.01.2008 22:37:27 von Edward Hass
"Edward Hass" wrote in message
news:2GUdj.606$yv5.235@trndny07...
> Is there a PHP equivalent to the JavaScript XMLHttpRequest function:
> ......
> myrequest.open('POST', url, true);
> .......
> myrequest.send(data);
>
> In other words, I'd like to get data from another web page that needs to
> receive input via the POST method.
>
> Thanks,
> Edward Hass
Thanks guys. . .I tried curl, and it worked fine - except that NY State
blocks people from using the site unless they enter through their own
portal.
Public servants anyone???
Regards,
Edward Hass
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 01:20:42 von Jerry Stuckle
Edward Hass wrote:
> "Edward Hass" wrote in message
> news:2GUdj.606$yv5.235@trndny07...
>> Is there a PHP equivalent to the JavaScript XMLHttpRequest function:
>> ......
>> myrequest.open('POST', url, true);
>> .......
>> myrequest.send(data);
>>
>> In other words, I'd like to get data from another web page that needs to
>> receive input via the POST method.
>>
>> Thanks,
>> Edward Hass
> Thanks guys. . .I tried curl, and it worked fine - except that NY State
> blocks people from using the site unless they enter through their own
> portal.
>
> Public servants anyone???
>
> Regards,
> Edward Hass
>
>
>
Well, it's harder, but you could use cURL to enter through their portal.
The biggest problem would be if they require javascript.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 02:16:36 von Michael Fesser
..oO(Edward Hass)
>Thanks guys. . .I tried curl, and it worked fine - except that NY State
>blocks people from using the site unless they enter through their own
>portal.
Blocking in what way? Do you receive an error message from the server?
Can you post the URL of the page that you want to access directly?
Maybe they're just checking the HTTP referrer, which is easy to fake if
a stupid server script should rely on it.
Micha
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 02:30:49 von ashore
Guys, I dunno what this exchange is all about. Like PHP is a server-
land programming language, and XMLHttpRequest is a client-land
function, which communicates client-to-server. Which you guys all
know very well.
It appears to me that the premise of the basic question is faulty, and
we oughtta ask Edward Hass to explain his question better. (Mebbe the
rest of you have figgered it out, but I sure ain't.)
AS
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 02:51:34 von Jerry Stuckle
ashore wrote:
> Guys, I dunno what this exchange is all about. Like PHP is a server-
> land programming language, and XMLHttpRequest is a client-land
> function, which communicates client-to-server. Which you guys all
> know very well.
>
> It appears to me that the premise of the basic question is faulty, and
> we oughtta ask Edward Hass to explain his question better. (Mebbe the
> rest of you have figgered it out, but I sure ain't.)
>
> AS
>
>
>
>
Yep, but PHP can still fetch pages (including with POST data) and
process them on the server end (or pass them back to the browser). I do
it for a few sites, like PayPal.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 02:54:04 von Michael Fesser
..oO(ashore)
>Guys, I dunno what this exchange is all about. Like PHP is a server-
>land programming language, and XMLHttpRequest is a client-land
>function, which communicates client-to-server. Which you guys all
>know very well.
Sure.
>It appears to me that the premise of the basic question is faulty, and
>we oughtta ask Edward Hass to explain his question better. (Mebbe the
>rest of you have figgered it out, but I sure ain't.)
IMHO the explanation was pretty clear:
| In other words, I'd like to get data from another web page that needs
| to receive input via the POST method.
If you want to do it from the client, you can use the XMLHttpRequest
object if available, from the server there's cURL and some other ways.
But the action performed is pretty much the same in both cases.
Micha
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 02:54:18 von luiheidsgoeroe
On Wed, 02 Jan 2008 02:30:49 +0100, ashore wrote:
> Guys, I dunno what this exchange is all about. Like PHP is a server-
> land programming language, and XMLHttpRequest is a client-land
> function, which communicates client-to-server. Which you guys all
> know very well.
>
> It appears to me that the premise of the basic question is faulty, and
> we oughtta ask Edward Hass to explain his question better. (Mebbe the
> rest of you have figgered it out, but I sure ain't.)
I only have Edward Hass's quote to go on, as I don't see the original
post. From that, to me his 'in other words' was quite clear, and clearly
something cURL could handle. The fact that an XMLHTTPRequest is the
default way in javascript of getting information from another URL has
little to do with it as far as I can tell. I grant you that I assume the
OP knows PHP only works on the server, not the client.
--
Rik Wasmus
Re: PHP equivalent to XMLHtttpRequest functions
am 02.01.2008 02:57:12 von Jerry Stuckle
Rik Wasmus wrote:
> On Wed, 02 Jan 2008 02:30:49 +0100, ashore wrote:
>
>> Guys, I dunno what this exchange is all about. Like PHP is a server-
>> land programming language, and XMLHttpRequest is a client-land
>> function, which communicates client-to-server. Which you guys all
>> know very well.
>>
>> It appears to me that the premise of the basic question is faulty, and
>> we oughtta ask Edward Hass to explain his question better. (Mebbe the
>> rest of you have figgered it out, but I sure ain't.)
>
> I only have Edward Hass's quote to go on, as I don't see the original
> post. From that, to me his 'in other words' was quite clear, and clearly
> something cURL could handle. The fact that an XMLHTTPRequest is the
> default way in javascript of getting information from another URL has
> little to do with it as far as I can tell. I grant you that I assume the
> OP knows PHP only works on the server, not the client.
Actually, XMLHTTPRequest has its own problems - like it can't get data
from a site other than the one it was loaded from. Unfortunately, IE6
and below don't enforce this restriction, but Firefox does.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================