peldur
peldur

Reputation: 11

(website data exchange || communication between sites) via php

Is there any way to send simple string

from websiteA.com -to-> websiteB.com with php?

Where websiteB.com "listens"(as not knowing the existence of websiteA.com) any incoming simple strings sent and receives it?

Upvotes: 1

Views: 271

Answers (2)

SergeS
SergeS

Reputation: 11799

Very very simple vay is to use "rest api" - eg. create PHP file, which will recieve string and process it , and return XML / JSON ... or other formatted ( or unformatted ) answer. Client site ( eg. A ) just need to fopen ( or send request using cURL ) this php file with approtiate string

More complex way is to use SOAP - it have standart object in PHP , but it is reccomed to write wsdl file, which is a bit complex. see google for details

Upvotes: 0

simshaun
simshaun

Reputation: 21476

  1. Setup a script on websiteB that handles a POST request (e.g. a string).

  2. Use cURL or sockets on websiteA to send POST data (e.g. a string) to websiteB

Upvotes: 2

Related Questions