I have a paypal buy now button I want to place on a page. I want to submit the form as soon as the page loads without delay. I can do this in javascript but not php. can some please help me out? That is the form below: <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="me@mydomain.com"> <input type="hidden" name="item_name" value="wonder"> <input type="hidden" name="item_number" value="safe"> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="tax" value="0"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="bn" value="PP-DonationsBF"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> Thanks!
You can't tell when a page has finished loading in the browser using PHP, the only way to do that is by JavaScript (and even that may not be entirely reliable).
Is there a way to use the tag below to forward the data to paypal and have it populate the fields using php? I believe I have seen it being done before but I can't remember where...please help! <?php header('Location:https://www.paypal.com/cgi-bin/webscr'); ?>
That code is effectively telling the browser to issue a GET request for the URL you've specified, which won't pass along any of the values for the fields because they're passed by POST. Why would you want do this anyway? Surely you want people to click on the button in order to submit the form rather than having it done quietly without them knowing?
The situation is that I am placing the button on a blog the will not accept the form tags. What I am attempting as a result is to send them to a file on my server which will then redirect to paypal and populate the appropriate fields when they click the buy button on the blog. Is there a workable solution to this problem? Please help me out. Thanks!
Why don't you just have the form code on your server, with a link to it from your blog? Then users can follow the link, fill in the form and be directed to Paypal. That is a workable solution.
Yes, I considered your suggestion prior to posting my question but I decided it was a very tacky solution which will create an additional step for my 'lazy' visitors. It is a donate button; the least I can do is make life easier for the donor. Having them complete a form could easily turn them off. I believe what I am looking for requires some very crafty and skillful programming which is probably beyond the capabilities of the forum members here. I have seen this done before but I just can't remember where to save my life. I will continue my search in a more advanced forum. I will bookmark this forum for more elementary tasks Thanks!
It's not beyond us, I just think you're making things harder than they need to be. Also, I wouldn't worry too much about donation buttons, I don't think many people actually bother to donate unless you're running a very high profile blog/software project.
If you are capable of solving it and it's an issue of $$$, simply get to the point and and stop dancing around the problem. This is not a political debate or a talk show. Neither am I asking for guidance councilling. Simply tell me what it's going to cost and let's get it out of the way so we can move on with our lives.
I can read english, but apparently you can't. How about we barter...I'll teach you english and you teach me PHP.
yeah, right! like anybody did something around here. Next time I come back, I'll will be teaching you.
Wow, Sageman, I know these forums can be a little frustrating for a newbie, becuase I am basically a newb myself. I have, however, been to many PHP forums and have found that these little misunderstandings exist in all of them. I think mostly it's due to REALLY smart programmers forgetting how to dumb things down for beginners, or in this case, maybe someone just misread what you wrote. It doesn't help to get mad though, it just gets you less help. I too have tried to have an auto submitted form to PayPal (but can't remember why now). I do know that I eventually gave up, went another route, and ended up liking that solution better. And I wasn't dealing for restrictions like from your BLOG. In the interest of helping you (I'm not positive that I have, or there is a solution) if I may ask you some questions and not have you bite my head off, I'd like to help if I can. Since I'm a newb and a scavenger of sorts, I too try to find ways around my lack of knowledge in PHP. So, to reiterate... you want a button link that says something like "Donate $5" on a BLOG that doesn't accept <form> tags? So you want that link to point to a page that already has a PayPal form with all of the fields filled out appropiately, that auto-submits? Also, if you have a javascript script that does this, why do not want to use it? Does the BLOG forbid that too? I understand you wnat to save a step, but you may have to live with one more button click. I'll help if I can though.