PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of hedi   valif   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: valif
Validate and generate form input values
Author: By
Last change:
Date: 18 years ago
Size: 1,794 bytes
 

Contents

Class file image Download
$validation = new valif;

$after_validation = $validation -> HEDI (
array (

// ----- NAME OF THE FORM TO BE VALIDATED
array( 'form2' ) ,


//-----NAME INPUT -- FUNCTION -- NAME DISPLAYED
// LISTE OF INPUT TO BE VALIDATED
array( 'test' , 'req' , 'TEST' ) ,
array( 'test1' , 'mail' , 'mail' ) ,
array( 'test3' , 'req_mail', 'email_req' ) ,
array( 'select' , 'req' , 'the select' )

)
);


if($after_validation == 1){
// EXECUTE THE NEEDED SCRIPT
}


?>
<style type="text/css">
<!--
.erreur {
    background-color: #FFD1C6;
}
-->
</style>


<form action="" method="post" name="form1">


 <input type="hidden" name="from" value="form2" />
 
 <input type="text" name="test" <?php $validation -> get_value("test",""); ?> ><br />
 <input type="text" name="test1" <?php $validation -> get_value("test1",""); ?>><br />
 <input type="text" name="test3" <?php $validation -> get_value("test3",""); ?>><br />

 
   
 <select name="select" <?php $validation -> get_selected("select",""); ?> >
     <option value="" <?php $validation -> get_selected("select",""); ?> > --- </option>
     <option value="369" <?php $validation -> get_selected("select","369"); ?> > 369 </option>
     <option value="444" <?php $validation -> get_selected("select","444"); ?> > 444 </option>
     <option value="132" <?php $validation -> get_selected("select","132"); ?> > 132 </option>
     <option value="8888" <?php $validation -> get_selected("select","8888"); ?> > 8888 </option>
     <option value="777" <?php $validation -> get_selected("select","777"); ?> > 777 </option>
 </select>
 
 
 
 <br />

 <input type="submit" value="ok">
</form>