dezkit Posted September 30, 2009 Share Posted September 30, 2009 Hello guys, I have this code: <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="xxx@xxx.xxx"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="item_name" value="Buy Admin"> <input type="hidden" name="button_subtype" value="products"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest"> <table> <tr><td><input type="hidden" name="on0" value="Server">Server</td></tr><tr><td><select name="os0"> <option value="All Servers">All Servers $60.00 <option value="Deathrun">Deathrun $10.00 <option value="Jailbreak">Jailbreak $10.00 <option value="Simpsons Freezetag">Simpsons Freezetag $10.00 <option value="RPG Surf">RPG Surf $10.00 <option value="Zombie Plague">Zombie Plague $10.00 <option value="Zombie Revolution">Zombie Revolution $10.00 </select> </td></tr> <tr><td><input type="hidden" name="on1" value="Type of admin">Type of admin</td></tr><tr><td><select name="os1"> <option value="Basic admin">Basic admin <option value="Full admin + $10.00">Full admin + $10.00 </select> </td></tr> <tr><td><input type="hidden" name="on2" value="In-game name">In-game name</td></tr><tr><td><input type="text" name="os2" maxlength="60"></td></tr> <tr><td><input type="hidden" name="on3" value="SteamID">SteamID</td></tr><tr><td><input type="text" name="os3" maxlength="60"></td></tr> </table> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="option_select0" value="All Servers"> <input type="hidden" name="option_amount0" value="60.00"> <input type="hidden" name="option_select1" value="Deathrun"> <input type="hidden" name="option_amount1" value="10.00"> <input type="hidden" name="option_select2" value="Jailbreak"> <input type="hidden" name="option_amount2" value="10.00"> <input type="hidden" name="option_select3" value="Simpsons Freezetag"> <input type="hidden" name="option_amount3" value="10.00"> <input type="hidden" name="option_select4" value="RPG Surf"> <input type="hidden" name="option_amount4" value="10.00"> <input type="hidden" name="option_select5" value="Zombie Plague"> <input type="hidden" name="option_amount5" value="10.00"> <input type="hidden" name="option_select6" value="Zombie Revolution"> <input type="hidden" name="option_amount6" value="10.00"> <input type="hidden" name="option_index" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> What I'm trying to do is so that if Type of admin is selected to Full admin, then the final price will have 10 dollars added. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/176015-if-selected-10-dollars-to-final-order-in-paypal/ Share on other sites More sharing options...
RussellReal Posted September 30, 2009 Share Posted September 30, 2009 if ($_POST['on1'] == 'Full admin + $10.00') { $total_price += 10; } Quote Link to comment https://forums.phpfreaks.com/topic/176015-if-selected-10-dollars-to-final-order-in-paypal/#findComment-927469 Share on other sites More sharing options...
dezkit Posted September 30, 2009 Author Share Posted September 30, 2009 Hi, thanks for the response, but I don't know where to put that. Here is my current code. <?php $submit_y = $_POST["submit_y"]; if(!$submit_y){ ?> <center> <form action="" method="post"> <table><tr><td align=right><input type="hidden" name="on0" value="In-game name">In-game name: </td><td><input type="text" name="os0" maxlength="60"></td></tr> <tr><td align=right><input type="hidden" name="on1" value="SteamID">SteamID: </td><td><input type="text" name="os1" maxlength="60"></td></tr> <tr><td align=right><input type="hidden" name="on2" value="Server">Server: </td><td><select name="os2"> <option value="All Servers">All Servers $60.00 <option value="Deathrun">Deathrun $10.00 <option value="Jailbreak">Jailbreak $10.00 <option value="Simpsons Freezetag">Simpsons Freezetag $10.00 <option value="RPG Surf">RPG Surf $10.00 <option value="Zombie Plague">Zombie Plague $10.00 <option value="Zombie Revolution">Zombie Revolution $10.00 </select> </td></tr> <tr><td align=right><input type="hidden" name="on3" value="Type of admin">Type of admin: </td><td><select name="os3"> <option value="Basic admin">Basic admin <option value="Full admin + $10.00">Full admin + $10.00 </select> </td></tr> </table> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" value="submit" alt="PayPal - The safer, easier way to pay online!"> </form> </center> <?php } else { ?> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="xxxxx@gmail.com"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="item_name" value="Buy Admin"> <input type="hidden" name="button_subtype" value="products"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="option_select0" value="All Servers"> <input type="hidden" name="option_amount0" value="60.00"> <input type="hidden" name="option_select1" value="Deathrun"> <input type="hidden" name="option_amount1" value="10.00"> <input type="hidden" name="option_select2" value="Jailbreak"> <input type="hidden" name="option_amount2" value="10.00"> <input type="hidden" name="option_select3" value="Simpsons Freezetag"> <input type="hidden" name="option_amount3" value="10.00"> <input type="hidden" name="option_select4" value="RPG Surf"> <input type="hidden" name="option_amount4" value="10.00"> <input type="hidden" name="option_select5" value="Zombie Plague"> <input type="hidden" name="option_amount5" value="10.00"> <input type="hidden" name="option_select6" value="Zombie Revolution"> <input type="hidden" name="option_amount6" value="10.00"> <input type="hidden" name="option_index" value="0"> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/176015-if-selected-10-dollars-to-final-order-in-paypal/#findComment-927903 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.