I created a website that has a registration form for a fundraiser event. It has simple fields such as “First Name, Last Name, Email, etc” After they click on “submit” on the first page, they are taken to another page where they can pay via Paypal.
I already know how to insert the Paypal feature where it says “Buy now”. However, for my case, I want to have 2 different Paypal forms:
- If a user has already registered for another particular conference, they pay $10 (I have the list of registered attendees in a database table already via phpmyadmin)
- If a user has not registered for the general conference, they pay $15
How do I code it so that I can validate if the user is in the database table of registered attendees and gets the $10 rate? (perhaps I can validate by email address used on the form)
This is what I have right now for my php file (It’s defaulted on the $15 regular rate for non-attendees)
<html>
<div class="container">
<head><title>Payment Page</title></head>
<body>
<h1>Step 2: Payment</h1>
<p class="content">Please proceed onto payment via Paypal.</p>
<div></div>
<ul>
<li>The fee for an attendee is $10</li>
<li>The fee for a non-attendee is $15</li>
</ul>
</body>
<head>
<link rel="stylesheet" type="text/css" href="container.css">
</head>
</html>
<div></div>
<br></br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="tracyjones@gmail.com">
<input type="hidden" name="item_name" value="Fundraiser">
<input type="hidden" name="item_number" value="Rate">
<input type="hidden" name="amount" value="15.00">
<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="lc" value="AU">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/en_AU/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_AU/i/scr/pixel.gif" width="1" height="1">
</form>
EDITED
Try this: