phpretard Posted April 22, 2008 Share Posted April 22, 2008 How can I echo all posted variable in one php statement? $_POST['mc_gross']; $_POST['address_status']; $_POST['payer_id']; $_POST['tax']; $_POST['address_street']; $_POST['payment_date']; $_POST['payment_status']; $_POST['charset']; $_POST['address_zip']; $_POST['first_name']; $_POST['address_country_code']; $_POST['address_name']; $_POST['notify_version']; $_POST['custom'];""> $_POST['payer_status']; $_POST['business']; $_POST['address_country']; $_POST['address_city']; $_POST['quantity']; $_POST['payer_email']; $_POST['verify_sign']; $_POST['txn_id']; $_POST['payment_type']; $_POST['payer_business_name']; $_POST['last_name']; $_POST['address_state']; $_POST['receiver_email']; $_POST['receiver_id']; $_POST['pending_reason']; $_POST['txn_type']; $_POST['item_name']; $_POST['mc_currency']; $_POST['item_number']; $_POST['residence_country']; $_POST['payment_gross']; $_POST['shipping']; These are all of the things that paypal gives back after payment. Thank you! Quote Link to comment Share on other sites More sharing options...
conker87 Posted April 22, 2008 Share Posted April 22, 2008 <?php foreach ($_POST[$p] as $var) { echo $p . ": " . $var; } ?> Don't quote me on this, I've not delved into foreach, but I think that might work. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 22, 2008 Share Posted April 22, 2008 How can I echo all posted variable in one php statement? $_POST['mc_gross']; $_POST['address_status']; $_POST['payer_id']; $_POST['tax']; $_POST['address_street']; $_POST['payment_date']; $_POST['payment_status']; $_POST['charset']; $_POST['address_zip']; $_POST['first_name']; $_POST['address_country_code']; $_POST['address_name']; $_POST['notify_version']; $_POST['custom'];""> $_POST['payer_status']; $_POST['business']; $_POST['address_country']; $_POST['address_city']; $_POST['quantity']; $_POST['payer_email']; $_POST['verify_sign']; $_POST['txn_id']; $_POST['payment_type']; $_POST['payer_business_name']; $_POST['last_name']; $_POST['address_state']; $_POST['receiver_email']; $_POST['receiver_id']; $_POST['pending_reason']; $_POST['txn_type']; $_POST['item_name']; $_POST['mc_currency']; $_POST['item_number']; $_POST['residence_country']; $_POST['payment_gross']; $_POST['shipping']; These are all of the things that paypal gives back after payment. Thank you! foreach ($_POST as $v) { echo "$v <br />"; } Quote Link to comment Share on other sites More sharing options...
947740 Posted April 22, 2008 Share Posted April 22, 2008 Here is a decent way. $all = <<<ENDOFTEXT; // All variables go here ENDOFTEXT; echo $all; -Simple and to the point, if you already have the variables written out. There is a problem with the previous ones if there are other $_POST values that you do not want echoed. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 22, 2008 Share Posted April 22, 2008 Here is a decent way. $all = <<<ENDOFTEXT; // All variables go here ENDOFTEXT; echo $all; -Simple and to the point, if you already have the variables written out. There is a problem with the previous ones if there are other $_POST values that you do not want echoed. He's only getting return post values from PayPal. Quote Link to comment Share on other sites More sharing options...
phpretard Posted April 22, 2008 Author Share Posted April 22, 2008 Would this take the place of all the POST statements? That's what it looks like... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 22, 2008 Share Posted April 22, 2008 How can I echo all posted variable in one php statement? One statement - echo "<pre>",print_r($_POST,true),"</pre>"; Quote Link to comment Share on other sites More sharing options...
phpretard Posted April 22, 2008 Author Share Posted April 22, 2008 Nice...PFMaBiSmAd Thank you all! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 22, 2008 Share Posted April 22, 2008 You have to be careful what you ask for and how you ask it in a programming language forum Someone might literally provide an answer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.