1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
class Form extends Stack
{ private $form, $formValid, $check ;
private $action, $method, $id, $name ;
/**
* From constructor
*
*/
function __construct($action = NULL, $method = NULL, $id = NULL, $name = NULL) {
// $this->initForm($form);
$this->action = ($action != NULL) ? $action : $_SERVER['PHP_SELF'];
$this->method = ($method != NULL) ? $method : 'POST';
//
// name OR id must be specified
// ============================
var_dump($id,$name) ;me donne NULL,NULL => pige pas pkoi
if ( ! (isset($id) || isset($name))) {
user_error("NAME or ID Should be specified" , E_USER_ERROR);
} elseif ( ! isset($id)) {
$id = $name;
} else {
$name = $id;
}
}
function __destruct()
{}
function validate()
{}
/**
* Form Start
*
*/
function start()
{
echo '<form action="/index.php" method="post" name="'.$this->name.'" id="'.$this->id.'">' ;
// echo "<form action='/index.php' method='post' name='.$this->name.' id='.$this->id.'>" ;
} |