Login   Register  
PHP Classes
elePHPant
Icontem

File: valtest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Harish Chauhan  >  Validations  >  valtest.php  >  Download  
File: valtest.php
Role: Example script
Content type: text/plain
Description: Example File
Class: Validations
Validate text values according several rules
Author: By
Last change:
Date: 2005-01-12 22:39
Size: 944 bytes
 

Contents

Class file image Download
<?php
require("validations.inc.php");

$val=new Validation;

if(
$val->is_email($_POST['email']))
    echo 
"Email is Valid!";
else
    echo 
"Not a valid email";
echo 
"<br>";

if(
$val->is_number($_POST['number']))
    echo 
"number is Valid!";
else
    echo 
"Not a valid number";
echo 
"<br>";

if(
$val->is_alpha_numeric($_POST['String']))
    echo 
"String is Valid!";
else
    echo 
"Not a valid String";
echo 
"<br>";
if(
$val->is_date($_POST['date'])>0)
    echo 
"date is Valid!";
else
    echo 
"Not a valid date";
echo 
"<br>";

?>
<FORM name='form1' method='post' action="">
<table>
<tr><td>Enter Email :</td><td><input name='email'></td></tr>
<tr><td>Enter Number :</td><td><input name='number'></td></tr>
<tr><td>Enter Date :</td><td><input name='date'>(mm-dd-yyyy)</td></tr>
<tr><td>Enter String :</td><td><input name='String'></td></tr>
<tr><td>Press Submit :</td><td><input name='Submit' type='submit'></td></tr>
</table>
</FORM>