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 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
<?php
if (isset($_POST['envoyer'])) {
session_start();
include 'config.php';
include 'connexion.php';
$msg_erreur = "Erreur. Les champs suivants doivent être obligatoirement remplis :<br/><br/>";
$msg_ok = "Votre demande a bien été prise en compte.";
$message = $msg_erreur;
foreach($_POST as $index => $valeur) {
$$index = mysql_real_escape_string(trim($valeur));
}
$_SESSION['nom']=$nom;
$_SESSION['prenom']=$prenom;
$sql = "INSERT INTO tlm_clients VALUES ('".$nom."', '".$prenom."','".$naissance."', '".$ss."' )";
$res = mysql_query($sql);
if ($res) { ?>
<h3> <?php echo $msg_ok;?></h3>
<?php } else { echo mysql_error();} ?>
<form method ="post" action="client_modifier.php">
<input type="submit" name="creer" value="Créer un jaquette"/>
<?php
}else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN"
"http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
<html Xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jaquette pour vous</title>
<link href="formulaire.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div id="header-logo">
<img src="images/logo2.png">
</div>
<div id="header-slogan">
<img src="images/slogan.png">
</div>
</div>
<div id="globalcont">
<h3>Créer un compte client:</h3>
<form method="POST" action="client.php" value="client">
<table class="table">
<tr><td><p>Nom :</p></td><td><input type="text" name="nom" size="30" /></td></tr>
<tr><td><p>Prénom :</p></td><td><input type="text" name="prenom" size="30" /></p></td></tr>
<tr><td><p>Date de naissance :</p></td><td><input type="text" name="naissance" size="30" /></p></td></tr>
<tr><td><p>Numéro de compte :</p></td><td><input type="text" name="ss" size="30" /></p></td></tr>
</table>
<br /><center><input type="submit" name="envoyer" value="Valider"/></center>
</form>
</div>
</body>
</html>
<?php
}
?> |