i want a alert that alert when press submit button if the date user have inserted is expired as today is 19 may 2009 if a user puts 18 may 2009 it alerts that card expired.
here is the code:-
PHP CODE:
<?php
$connection = mysql_connect("localhost","root","autodeskmaya") or die("error connect");
mysql_select_db("online_bus_project");
if(isset($_POST['submit']))
{
header("location: http://localhost/site/printticket.php");
$first_name = $_POST["fname"];
$card_number = $_POST["card_number_field1"] . $_POST["card_number_field2"] . $_POST["card_number_field3"] . $_POST["card_number_field4"];
$expiry_date = $_POST["card_exp_month"] . $_POST["card_exp_year"];
$query = "INSERT INTO payment (name, number, expire) VALUES('$first_name', '$card_number','$expiry_date')";
mysql_query($query, $connection) or die(mysql_error());
}
?>
HTML FORM:
<div class="style3" id="payment_box">
<form name="payment" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<center>Make Payment<br />
</center>
<br /><br /><br />
Card Holder's Name: <input name="fname" type="text" id="fname" />
<br /><br />
Card Number:
<INPUT name="card_number_field1" type="text" id="card_number_field1" size="4" maxlength="4" />
<INPUT name="card_number_field2" type="text" id="card_number_field2" size="4" maxlength="4">
<INPUT name="card_number_field3" type="text" id="card_number_field3" size="4" maxlength="4">
<INPUT name="card_number_field4" type="text" id="card_number_field4" size="4" maxlength="4">
<br /><br />
Card Expiry Date:   <INPUT name="card_exp_month" type="text" id="card_exp_month" size="2" maxlength="2">
/
<INPUT name="card_exp_year" type="text" id="card_exp_year" size="4" maxlength="4">
</center><br /><br />
<center><input name="submit" type="submit" onclick="MM_validateForm('fname','','R','card_number_field1','','RisNum','card_number_field2','','RisNum','card_number_field3','','RisNum','card_number_field4','','RisNum','card_exp_month','','RisNum','card_exp_year','','RisNum');return document.MM_returnValue" value="Submit" />
</form>
</div>
form is validate thats why it contains javascript.
these two fields are the expiration in which i want that alert
<INPUT name="card_exp_month" type="text" id="card_exp_month" size="2" maxlength="2">/<INPUT name="card_exp_year" type="text" id="card_exp_year" size="4" maxlength="4">
month and year is on numbers like [05]\[2009]