fp2146 Posted September 3, 2008 Share Posted September 3, 2008 I am a rookie. I have a simple question that I have spent more time trying to find the answer to than I care to admit. Anyhow, I'm using a service called e-junkie which connects with PayPal. e-junkie can send data to my php url that is essentially PayPal transaction data. Following is their instruction to capture this transaction data: "All the order data for each product in the order can be sent to script on your server in the background. To enable this behavior, check "Send payment data to my server" while adding or editing your product. Press NEXT/SUBMIT and enter the URL in Payment Variable Information URL field. All the order data will be sent to the URL you have specified for each product in the order individually." I asked them for help with syntax and this is what I received: "We send data via POST and it's accessible via $_POST global array available to PHP." So, if my website is named "mywebsite.com and my php page is called "receivedata.php" I would do "mywebsite.com/receivedata.php." The question is, what, if anything, do I need to put after the "receivedata.php" to receive the variables they are sending POST? Or, does there script automatically fill my $_POST global array? Following is my "receivedata.php" script: </head> <body> <?php <table border=1> <tr><th>Parameter Name</th><th>Value</th></tr> <?php foreach ( \$_POST as \$param_name => \$value ) { echo "<tr> <td>\$param_name</td> <td>\$value</td> </tr>\\n"; } ?> </table> END; ?> <p>Which appears on a page as:</p> <table border=1> <tr><th>Parameter Name</th><th>Value</th></tr> <?php foreach ( $_POST as $param_name => $value ) { echo "<tr> <td>$param_name</td> <td>$value</td> </tr>\n"; } ?> </table> </body> </html> Thank you very much for your help with this very elemental question. Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/ Share on other sites More sharing options...
Adam Posted September 3, 2008 Share Posted September 3, 2008 No they'll send the data to the POST array with their script... If they had sent the data to the GET array then there would be added values to the URL in the form of something like.. receivedata.php?something=this&somethingelse=that If thats what you were tryin to ask? Adam Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633155 Share on other sites More sharing options...
DarkWater Posted September 3, 2008 Share Posted September 3, 2008 Why do you have all those \ before your variables' $? Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633161 Share on other sites More sharing options...
fp2146 Posted September 4, 2008 Author Share Posted September 4, 2008 Quote Why do you have all those \ before your variables' $? Thanks for telling me I don't need 'em. Thanks for your response. Some silicone sister with a manager mister told me I go what it takes She said "I'll turn you on sonny to something strong, play the song with the funky break" Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633271 Share on other sites More sharing options...
fp2146 Posted September 4, 2008 Author Share Posted September 4, 2008 Quote No they'll send the data to the POST array with their script... If they had sent the data to the GET array then there would be added values to the URL in the form of something like.. receivedata.php?something=this&somethingelse=that If thats what you were tryin to ask? Adam Yes, thanks for the clear answer to a basic simple question! Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633272 Share on other sites More sharing options...
DarkWater Posted September 4, 2008 Share Posted September 4, 2008 Quote Quote Why do you have all those \ before your variables' $? Thanks for telling me I don't need 'em. Thanks for your response. Some silicone sister with a manager mister told me I go what it takes She said "I'll turn you on sonny to something strong, play the song with the funky break" Yeah, I'm surprised it didn't give you a syntax error to be completely honest....and did you actually know the song, or did you Google it? Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633280 Share on other sites More sharing options...
fp2146 Posted September 4, 2008 Author Share Posted September 4, 2008 Quote Quote Quote Why do you have all those \ before your variables' $? Thanks for telling me I don't need 'em. Thanks for your response. Some silicone sister with a manager mister told me I go what it takes She said "I'll turn you on sonny to something strong, play the song with the funky break" Yeah, I'm surprised it didn't give you a syntax error to be completely honest....and did you actually know the song, or did you Google it? I know the song well from Manfred Mann and Bruce Springstein. I never cared for Bruce's version much. I wish I were as good with php! Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633332 Share on other sites More sharing options...
DarkWater Posted September 4, 2008 Share Posted September 4, 2008 Lol, thanks. Is your problem sorted yet, or no? >_< Also, I never cared too much for Bruce's version either. It's kinda boring compared to Manfred Mann's. I think that was like, the only song from them that anyone ever knew. >_< Link to comment https://forums.phpfreaks.com/topic/122622-help-needed-with-syntax-for-sendingreceiving-post-variables/#findComment-633359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.