1

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
peldur
  • 11
  • 1

2 Answers2

2
  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

simshaun
  • 21,263
  • 1
  • 57
  • 73
0

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

SergeS
  • 11,533
  • 3
  • 29
  • 35