473,473 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP equivalent to XMLHtttpRequest functions

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
Dec 30 '07 #1
10 2246
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.
js*******@attglobal.net
==================

Dec 30 '07 #2
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/
Dec 31 '07 #3
"Edward Hass" <ne*******@magiciandb.comwrote 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
Jan 1 '08 #4
Edward Hass wrote:
"Edward Hass" <ne*******@magiciandb.comwrote 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.
js*******@attglobal.net
==================

Jan 2 '08 #5
..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
Jan 2 '08 #6
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

Jan 2 '08 #7
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.
js*******@attglobal.net
==================

Jan 2 '08 #8
..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
Jan 2 '08 #9
On Wed, 02 Jan 2008 02:30:49 +0100, ashore <sh*****@gmail.comwrote:
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
Jan 2 '08 #10
Rik Wasmus wrote:
On Wed, 02 Jan 2008 02:30:49 +0100, ashore <sh*****@gmail.comwrote:
>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.
js*******@attglobal.net
==================

Jan 2 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vannela | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
16
by: jonathan cano | last post by:
QUESTION: In practice, lines 36 and 37 below are usually equivalent to the default copy constructor (.e.g line 33). My questions are: (a) Does ISO 14882 guarantee that lines 36 and 37 are...
2
by: gimme_this_gimme_that | last post by:
Assuming data is being stored in a DB2 TIMESTAMP what is the equivalent of Oracle's to_date function : to_date('03/04/2005','MM/DD/YYYY') It's OK if MM/DD/YYYY is the only supported format....
6
by: exquisitus | last post by:
Hi all, I'm porting a DOS application to run on Linux. I need to replace this function or use an equivalent. Anyone knows how or where I can get this function's equivalent (or maybe someones...
5
by: BH | last post by:
Hi what would be the C# equivalent of a VB.NET file that looks like this: Module Utilities Public Sub UtilitySubOne ( ByVal arg As String) // blah blah End Sub
2
by: Sunkam Santhoshi | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
17
by: Mike Labosh | last post by:
I would really rather use the "dot-nettified" syntax rather than digging global functions out of Microsoft.VisualBasic. Anyone know the newfangled way to achieve the same results? -- Peace &...
5
by: dhruba.bandopadhyay | last post by:
I am trying to port an old Pascal DOS game to DOS C/C++. I am wondering if anyone is familar with the dos & crt Pascal units and whether there are C/C++ equivalent libraries. Maybe dos.c & crt.c? ...
22
by: Kurien Mathew | last post by:
Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next;
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.