what is the & in a variable

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
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

what is the & in a variable

Post by jonnyfortis »

i have been sent some variables from PAYPAL

Code: Select all

&custom=
&tax=0.00
&quantity=1
&mc_fee=1.25
&payment_fee=
&item_name=
&item_number=
&test_ipn=1
&receipt_id=0000-0000-0000-0000
&handling_amount=0.00
&shipping=0.00
the variable i have at the moment are

Code: Select all

$itemNumber = $_POST['item_number'];
$paymentStatus = $_POST['payment_status'];
$payerStatus = $_POST['payer_status'];
$pendingReason = $_POST['pending_reason'];
$txnID = $_POST['txn_id'];
$receiverEmail = $_POST['receiver_email'];
how do i use the news ones with the old ones as i am unsure why they have a & instead of the $

thanks
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: what is the & in a variable

Post by Celauran »

How are you getting these variables? That looks remarkably like a query string.
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: what is the & in a variable

Post by jonnyfortis »

from paypal. what do i do with them?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: what is the & in a variable

Post by Christopher »

It looks like they are the parameters you should send to PayPal -- either as POST parameters or GET query string parameters.
(#10850)
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: what is the & in a variable

Post by jonnyfortis »

Christopher wrote:It looks like they are the parameters you should send to PayPal -- either as POST parameters or GET query string parameters.
this is what paypal said to me

There are some more parameters in the sandbox IPN messages with Pro payments.

&custom=
&tax=0.00
&quantity=1
&mc_fee=1.25
&payment_fee=
&item_name=
&item_number=
&test_ipn=1
&receipt_id=0000-0000-0000-0000
&handling_amount=0.00
&shipping=0.00

this says to me that this is the response i get back from the IPN
Post Reply