[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 error_reporting(E_ALL); 3 4 require_once 'Savant2.php'; 5 $Savant2 =& new Savant2(); 6 $Savant2->addPath('template', 'templates/'); 7 $Savant2->addPath('resource', 'resources/'); 8 9 $defaults = array( 10 'hideme' => null, 11 'mytext' => null, 12 'xbox' => null, 13 'picker' => null, 14 'picker2' => null, 15 'chooser' => null, 16 'myarea' => null 17 ); 18 19 $values = array_merge($defaults, $_POST); 20 21 $tmp = array(); 22 23 if ($values['mytext'] == '') { 24 // required 25 $tmp[] = 'required'; 26 } 27 28 if (strlen($values['mytext']) > 5) { 29 // max 5 chars 30 $tmp[] = 'maxlen'; 31 } 32 33 if (preg_match('/[0-9]+/', $values['mytext'])) { 34 // no digits 35 $tmp[] = 'no_digits'; 36 } 37 38 if (count($tmp) == 0) { 39 $valid = array('mytext' => true); 40 } else { 41 $valid = array('mytext' => $tmp); 42 } 43 44 $Savant2->assign('opts', array('one', 'two', 'three', 'four', 'five')); 45 $Savant2->assign($values); 46 $Savant2->assign('valid', $valid); 47 48 $Savant2->display('form.tpl.php'); 49 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |