Jump to content

Help Needed With Syntax for Sending/Receiving Post Variables


fp2146

Recommended Posts

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.

 

 

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

  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"

 

  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!

  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?

  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!

Lol, thanks. :D  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. >_<

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.