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! Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/ 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. Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524203 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 />"; } Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524204 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. Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524206 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. Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524208 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... Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524210 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>"; Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524215 Share on other sites More sharing options...
phpretard Posted April 22, 2008 Author Share Posted April 22, 2008 Nice...PFMaBiSmAd Thank you all! Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524220 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. Link to comment https://forums.phpfreaks.com/topic/102377-solved-_post-question/#findComment-524227 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.