Say you want to pass data from file 1 to file 2 on same server. What you do ?

You post data from file 1 and in file 2 you fetch the data.

Same needs to be done and it is independent of domain name.