English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How can I pass a variable in php between 2 different sites located on different servers without using URL variables or Cookies?

2007-02-21 15:28:42 · 2 answers · asked by nos8wire 2 in Computers & Internet Programming & Design

2 answers

If you are talking about carrying the information with a particular user without putting that info itself in the querystring, the easiest way is to pass a GUID identifier for the information and expose it via SOAP or some other method. Essentially the process is as follows:

1. Create an object with the information you need to share, and give the object a unique ID (a GUID is an easy way to do this - see http://us3.php.net/uniqid )

2. Store the object and the GUID somewhere like a database that can be retrieved.

3. Direct the user to site #2 with the GUID:
site2.com/ receiveuser.php? info=[uniqueid]

4. The script on site #2 takes the uniqueid and requests a web service on site #1, sending the uniqueid

5. The web service returns a SOAP formatted version of your original object to site #2.

Read more about SOAP and web services in PHP here: http://us2.php.net/soap

2007-02-21 15:40:15 · answer #1 · answered by Rex M 6 · 0 0

Do you have access to both servers? If so you can encode a tcp/ip connection between them in PHP or Perl or something. Or possibly save them to a file and rsync it every so often with a cronjob?

2007-02-21 15:34:08 · answer #2 · answered by RandomMan 4 · 0 1

fedest.com, questions and answers