How to post data across multiple sites using PHP?

I dont know much about XML. I have a solution.

Put data into the database from site A.

Redirect a file from another site B. And then redirect to Site A back again with the data in the URL.

Is there a simple way to do this using PHP?