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 70 71 72 73 74 75 76 77 78 79 80 81
|
<?php
var_dump($_POST);
mysql_error();
if(isset($_POST['Nom_prenom']) && isset($_POST['Date_de_naissance']) && isset($_POST['Adresse']) && isset($_POST['Ville']) && isset($_POST['Cp']) && isset($_POST['Civil']) && isset($_POST['Email'])&& isset($_POST['Telephone'])&& isset($_POST['Code']) && $_POST['Nom_prenom'] != "" && $_POST['Date_de_naissance'] != "" && $_POST['Adresse'] != "" && $_POST['Ville'] != "" && $_POST['Cp'] != "" && $_POST['Civil'] != "" && $_POST['Email'] != ""&& $_POST['Telephone'] != ""&& $_POST['Code'] != ""){
$Nom_prenom = $_POST['Nom_prenom'];
$Date_de_naissance = $_POST['Date_de_naissance'];
$Adresse =$_POST['Adresse'];
$Ville = $_POST['Ville'];
$Cp= $_POST['Cp'];
$Civil = $_POST['Civil'];
$Email = $_POST['Email'];
$Telephone = $_POST['Telephone'];
$Code = $_POST['Code'];
$connect= mysql_connect('localhost','client','31p71h49') or die('Impossible de se connecter au serveur MySQL');
mysql_select_db("phplogin");
mysql_query("INSERT INTO clients Nom_prenom,Date_de_naissance,Adresse,Ville,Cp,Civil,Email,Telephone,Code)VALUES('$Nom_prenom','$Date_de_naissance','$Adresse','$Ville','$Cp','$Civil','$Email','$Telephone','$Code')");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Nouveau client-CashProg</title>
<LINK rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p><font color="red">/!\ Tous les champs doivent être remplis /!\</font>
<form method="POST" action="nouveauxclient.php">
<center><fieldset><legend><font color="red">Nouveaux Client</font></legend>
<TABLE BORDER=0>
<TR>
<TD><input type="text" name="Code" value="<?php echo rand(1, 9999999) ?>" /></TD>
<TD><label for="Civil">Civilité:</TD>
<TD>
<select name="Civil">
<option>Mr.</option>
<option>Mlle</option>
<option>Mme</option>
</select></TD>
<TD>Nom et prenom</TD>
<TD>
<INPUT type=text name="Nom_prenom">
</TD>
</TR>
<TR>
<TD>Adresse</TD>
<TD>
<INPUT type=text name="Adresse">
</TD>
<TD>Code Postal</TD>
<TD>
<INPUT type=text name="Cp">
</TD>
</TR>
<TR>
<TD>Ville</TD>
<TD>
<INPUT type=text name="Ville">
</TD>
<TD>Telephone</TD>
<TD>
<INPUT type=text name="Telephone">
</TD>
</TR>
<TR>
<TD>Email</TD>
<TD>
<INPUT type=text name="Email">
</TD>
<TD>Date de naissance</TD>
<TD>
<INPUT type=text name="Date_de_naissance">
</TD>
</TABLE></center>
<center><INPUT border=0 src="ok.png" type=image Value=submit align="middle" > </center>
</FORM><br><br/>
</fieldset><center>
</body>
</html> |
Partager