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 47 48 49 50 51 52 53 54 55
|
function ajout()
{
require('client.php');
$EX=AJOU;
require('ajout_client.mod');
} //ajout()
function ajoucli()
{
require_once('CUser.php');
$cli = new CUser();
$cli->Set_login($_POST['login']);
$cli->Set_pwd($_POST['pwd']);
$nomcli = $cli->Insert();
start();
}
} //ajoucli()
function Insert()
{
$query = "SELECT MAX(IDC) FROM USERS";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
$this->value['IDC'] = $row[0] + 1;
$this->Varchar($this->value['LOGIN']);
$this->Varchar($this->value['PWD']);
$query = "INSERT INTO USERS VALUES(".$this->value['IDC'].",'"
.$this->value['LOGIN']."','"
.$this->value['PWD']."')";
$result = mysql_query($query);
echo $query;
return $this->value['IDC'];
} //Insert()
//et le fichier ajout_client.mod
<div id="form">
<form method="POST" action="gestionclient.php">
<fieldset>
<input type="hidden" name="EX" value="<?= $EX ?>" />
<p>
<label>login :</label>
<input type="text" name="login" />
</p>
<p>
<label>password:</label>
<input type="text" name="pwd" />
</p>
<input type="hidden" name="idc" value="<?= $_REQUEST['nomcli'] ?>" />
<p>
<center> <input type="submit" value="ajouter" /> </center>
</p>
</fieldset>
</form>
</div> |