Basically I want the user to select the current month and day that they left a review, click submit, then given a random coupon code. I want the coupon code, the month they selected, and the day they selected to get inserted into the database.
HTML Page
<form action="redeem.php" method="post">
<select name="month">
<option>Select Month</option>
<option value="1">January</option>
<option value="2">February</option>
(Just took this part out to save room for DaniWeb)
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="day">
<option value="1">1</option>
<option value="2">2</option>
(Just took this part out to save room for DaniWeb)
<option value="30">30</option>
<option value="31">31</option>
</select>
<input type="submit" name="Submit" value="Submit">
</form>
PHP Page
<?php
$con = mysql_connect("localhost","dbname","dbpassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$RandomNum = rand(10000000,19999999);
echo 'Thank you for taking time out to leave us a review.';
echo '<br><br>';
echo 'Please save this code for 5% off your next service.';
echo '<br><br><br><b><font color="ff6600">';
echo $RandomNum;
echo '</font></b><br><br>';
echo 'This code does not expire.';
echo '<br><br>';
echo 'Simply tell us the code when you call us for your next service.';
mysql_select_db("dbname", $con);
mysql_query("INSERT INTO Coupon (Coupon, Month, Day)
VALUES ($RandomNum, '$_POST[month]', '$_POST[day]')");
mysql_close($con);
?>
</div>
<?php
} else {
?>
Just now replaced the database name and password for privacy purposes. I get a white blank screen when I choose dates and click submit, and nothing happens. Please help.