PHP, HTML, and Forms...Oh my!
Posted 02 April 2006 - 06:53 PM
The form is a PayPal button. So, it points to PayPal. I'm wondering if I should point it to my own PHP script then to PayPal, or can I just capture one value without this extra step?
Here is the HTML form:
<form action="https://www.paypal.c...cgi-bin/webscr" method="post" target="paypal">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="firstname.lastname@example.org">
<input type="hidden" name="item_name" value="Pay me now">
<input type="hidden" name="item_number" value="xyz123">
<input type="text" name="amount" size="4" maxlength="7">
<input type="submit" name="submit" value="Submit">
I need to capture the amount that they enter for their payment and write that to a flat file. Then I'm taking that file and adding it to some nifty flash animation.
Posted 02 April 2006 - 07:48 PM
one is get an onclick event on the submit button opening a page which gives you the var.
one is get a page collecting the data, doing your stuff, then continue with a header location through get.
one is get a page collecting the data, filling it into a hidden form, doing your stuff, then body onload submit form.
however, none of these I consider to be 'neat'. Aren't there any other ways you can think of?
Posted 04 April 2006 - 05:23 AM
I can't stop you from doing something silly, but at least I can help you do it right.
Posted 04 April 2006 - 06:33 AM
Is it really that hard to just check your account from time to time and see how much money you're making? Aside from that, PayPal should send you emails when you recieve payments...maybe you can use a PHP script to check the email, make sure it's from that site, and then add it to the flat file.
Posted 04 April 2006 - 11:31 PM
PayPal has their IPN system that I can use to have the finished transaction written to a MySQL DB. So, I just need to set it up so that when someone refreshes the page, a script check the DB for new donations, adds them to the old and displays the amount in Flash.
Hmmm....now, how to do that?
Maybe a PHP script can be triggered to check the DB and write the new total to the flat file so that Flash can use it? Maybe I'm in way over my head.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users