I would like make a script using PHP (probably need JS) to send POST data to another webpage and get the result back.
For example, Domain A will have a form with a textbox and submit button, and Domain B will have a script which will fill the textbox and press the submit button and return the generated HTML page.
The following lines of code can be written on another php script,
Now $result will contain the text received from the other website.