Passing variables between PHP scripts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
boroje
Forum Newbie
Posts: 1
Joined: Sun Nov 21, 2010 1:44 pm

Passing variables between PHP scripts

Post by boroje »

I don't know much about php (I understand programming in general but don't know php syntax). I need to pass variables from one php script to another (on different domain). Esentially, some variables will be returned to my first script from PayPal IPN, and that first php script will decide to what web site php script to send data passed from PayPal. I'll figure out how to if statements or loops, if necessary, but I need to know how the syntax look for passing data to second script.

Let say first php script is called first.php, and variables "value" and "price" are passed from paypal to first.php (first.php is on server datafirst.com). Now I need to pass those same variables to datasecond.com php script called second.php).

How would the syntax for sending data look like in first.php?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Passing variables between PHP scripts

Post by califdon »

There are several ways to pass variables between PHP scripts. Sometimes one is more appropriate to use than another. The website http://www.tizag.com/phpT/phpsessions.php has good tutorials on all this, as does http://www.w3schools.com/php/php_sessions.asp.
Post Reply