Newbie question : Using PHP to to receive and forward xml

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
heyniwe
Forum Newbie
Posts: 1
Joined: Tue Jun 18, 2002 5:19 pm

Newbie question : Using PHP to to receive and forward xml

Post by heyniwe »

Hi,
Totally new to PHP so please forgive any ignorance.

I have a Flash built eCommerce website which needs to send/receive xml requests/responses from a banks server. My problem is that Flash can only send and load xml data from its own webserver.

My idea is to use a PHP script as sort of a proxy server that will sit on my webserver and receive the xml request from the client...pass it on to the bank server, receive the xml response from the bank and pass it back to the client.

Can this be done with PHP? If so, does anyone have any good advice and were a PHP newbie should start to try and figure this out?

Much Thanks in advance!
nick
pacco
Forum Newbie
Posts: 2
Joined: Tue Jun 18, 2002 5:42 pm
Location: Toronto, Canada
Contact:

Post by pacco »

I'm no expert, but this should be possible using PHP's network and file functions.

Once the PHP script on your server receives the information from the Flash program, it should open a socket with fsockopen(), then send and receive protocol data using the file functions fputs() and fgets(). Once it is finished it should close the socket with fclose() and output the data back to your flash program.

Check the manual for those functions and it should become clear how to go about using them for your purpose.
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

I would imagine the banks server is using some kind of encryption, fsockopen may not work with this :?
Post Reply