简体   繁体   中英

Custom paypal website integration with PHP

I am having a problem with my paypal form. This form was working for me when I only had a field for a client to type in an amount they wished to pay. I modified it so that there would be three radio buttons. 2 for specified amounts (pulled from a mySQL database using php) and the final still being a client specified amount. If you use the last option of the specified amount everything works fine- but if you use the other two amounts that are specified on the page the client must click "update" on the left hand panel on the paypal generated page. How can I arrange this so that the update button does not need to be pushed on the first two options?

I have included screen shots of everything

Thanks for your help

image is here: http://i.stack.imgur.com/LH4eE.png

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                            <fieldset>
                                <input type="hidden" name="cmd" value="_xclick" />
                                <input type="hidden" name="business" value="# !!I have my paypal email here" />
                                <input type="hidden" name="lc" value="US" />
                                <input type="hidden" name="item_name" value="Service Booking" />
                                <input type="hidden" name="item_number" value="BOOKING" />
                                <input type="hidden" name="currency_code" value="USD" />
                                <input type="hidden" name="button_subtype" value="services" />
                                <input type="hidden" name="no_note" value="0" />
                                <input type="hidden" name="cn" value="Comments" />
                                <input type="hidden" name="no_shipping" value="1" />
                                <input type="hidden" name="rm" value="1" />
                                <input type="hidden" name="return" value="http://www.alphadogentertainment.com/booksuccess.php" />
                                <input type="hidden" name="cancel_return" value="http://www.alphadogentertainment.com/bookcancel.php" />
                                <input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynowCC_LG.gif:NonHostedGuest" />
<input type="hidden" name="os0" value="<?php print("$lastname");?> <?php print("$event");?>" />
<input type="hidden" name="on0" value="Event" />
                                <table>
                                        <tr><td style="padding:0 5px 5px 0;">Amount:</td><td style="padding:0 5px 5px 0;"><input type="radio" name="amount" value="<?php print("$deposit");?>" />Deposit: $<?php print("$deposit");?><br><input type="radio" name="amount" value="<?php print("$quote");?>" />Balance: $ <?php print("$quote");?><br><input type="radio" name="amount" value="">Other Amount: <input type="text" name="amount" /></td></tr>

                                        <tr><td>&nbsp;</td><td style="padding:0 5px 5px 0;">
                                                <input style="position:relative; left:-10px; background:#ffffff; border:0;" type="image" src="http://alphadogentertainment.com/images/bookbutton.jpg" name="submit" alt="PayPal" />
                                                <img alt="" style="border:0;" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" />
                                        </td></tr>
                                </table>
                            </fieldset>
                        </form>

You need to modify the below line of code :

Remove this line of code

<tr><td style="padding:0 5px 5px 0;">Amount:</td><td style="padding:0 5px 5px 0;"><input type="radio" name="amount" value="<?php print("$deposit");?>" />Deposit: $<?php print("$deposit");?><br><input type="radio" name="amount" value="<?php print("$quote");?>" />Balance: $ <?php print("$quote");?><br><input type="radio" name="amount" value="">Other Amount: <input type="text" name="amount" /></td></tr>

And paste this one :

<tr><td style="padding:0 5px 5px 0;">Amount:</td><td style="padding:0 5px 5px 0;"><input type="radio" name="amount" value="">Other Amount: <input type="text" name="amount" /><br><input type="radio" name="amount" value="<?php print("$deposit");?>" />Deposit: $<?php print("$deposit");?><br><input type="radio" name="amount" value="<?php print("$quote");?>" />Balance: $ <?php print("$quote");?></td></tr>

I just changed the order of the options . I have put the option 3 on the first place and it is working fine with this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM