Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Muammad Naeem  >  Date validation  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example File
Class: Date validation
Validates a date and displays an error message
Author: By
Last change:
Date: 2003-06-20 04:43
Size: 1,917 bytes
 

Contents

Class file image Download
<html>
<head><title>Date Validation Class by Naeem ...Pakistan (naeem@email.com)</title></head>
<style type = 'text/css'>
BODY
{
   background-color: #ffffe8;     
}
A
{
    color: blue;    
    text-decoration: none;
    font-size: x-small;
    font-weight : bold;
}
A:HOVER
{
   color: red;      
   background-color: silver;    
}
</style>

<body>
 <form action= <?php echo $PHP_SELFphp?> method="post" >
 <table align=center border=1 bordercolor=pink><caption>Date Validation Calss Example</caption>
 <tr>
  <td>Testing Date</td>
  <td>
    <select name="d">
    <?php
      
for ($i 1$i 32$i++)
         echo 
"<option value=".$i.">" $i "</option>";      
    
php?>
    </select>

    <select name="m">
     <option value="1">January</option>
     <option value="2">February</option>
     <option value="3">March</option>
     <option value="4">April</option>
     <option value="5">May</option>
     <option value="6">June</option>
     <option value="7">July</option>
     <option value="8">August</option>
     <option value="9">September</option>
     <option value="10">October</option>
     <option value="11">November</option>
     <option value="12" selected>December</option>
    </select>

<?php $dt_y intval(date(Y)); php?>
    <select name="y">
    <?php
     
for ($i $dt_y$i 3000$i++)
         echo 
"<option value=" $i ">" $i "</option>";
    
php?>
    </select>

  </td>
 </tr>
 <tr><td align=center colspan=2><a href=mailto:naeem@email.com>Designed by Naeem (Pakistan)</a></td></tr>
 <tr><td align=center colspan=2><input type=submit name="btn_submit" value="Validate Date"></td></tr>
 
</table>
 </form>
</body>

</html>
               
<?php include("_class_date_validate.php"); php?>

<?php

if ($btn_submit == "Validate Date")
{

 
$dt = new date_validate();
 echo ( 
$dt->validate($d $m $y) ) ;

}
php?>