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
| // Mise en variables simples des valeurs du formulaire
$radiok = htmlentities(addslashes($_POST['radiok']));
$radiocd = htmlentities(addslashes($_POST['radiocd']));
$alarme = htmlentities(addslashes($_POST['alarme']));
$jante = htmlentities(addslashes($_POST['jante']));
$touvrant = htmlentities(addslashes($_POST['touvrant']));
$climatisation = htmlentities(addslashes($_POST['climatisation']));
$retroelectriques = htmlentities(addslashes($_POST['retroelectriques']));
$vcentral = htmlentities(addslashes($_POST['vcentral']));
$dassister = htmlentities(addslashes($_POST['dassister']));
$vitrelectrique = htmlentities(addslashes($_POST['vitrelectrique']));
$selectrique = htmlentities(addslashes($_POST['selectrique']));
$airbagconduc = htmlentities(addslashes($_POST['airbagconduc']));
$airbagpassager = htmlentities(addslashes($_POST['airbagpassager']));
$ordibord = htmlentities(addslashes($_POST['ordibord']));
$scuir = htmlentities(addslashes($_POST['scuir']));
$abs = htmlentities(addslashes($_POST['abs']));
$autresoption = htmlentities(addslashes($_POST['autresoption']));
$madame = htmlentities(addslashes($_POST['madame']));
$mademoiselle = htmlentities(addslashes($_POST['mademoiselle']));
$monsieur = htmlentities(addslashes($_POST['monsieur']));
$nomprenom = htmlentities(addslashes($_POST['nomprenom']));
$particulier = htmlentities(addslashes($_POST['particulier']));
$professionnel = htmlentities(addslashes($_POST['professionnel']));
$collaborateur = htmlentities(addslashes($_POST['collaborateur']));
$adresse = htmlentities(addslashes($_POST['adresse']));
$ville = htmlentities(addslashes($_POST['ville']));
$pays = htmlentities(addslashes($_POST['pays']));
$telephone = htmlentities(addslashes($_POST['telephone']));
$email = htmlentities(addslashes($_POST['email']));
$bdd = "depotannonce_suite";
$suitannonce = "suitannonce";
// Reporte toutes les erreurs PHP (Voir l'historique des modifications)
error_reporting(E_ALL);
// On vérifie qu'il y a bien eu un envoi de données.
// Pour cela, on vérifie que le champ "prenom" à bien été rempli
if(isset($_POST['radiok']));
{
// D'abord, on se connecte à MySQL
mysql_connect('localhost', 'root', 'mysql') or die(mysql_error());
mysql_select_db($bdd) or die(mysql_error());
// Enregistrement dans la base de donnees
mysql_query ("INSERT INTO suitannonce (radiok, radiocd, alarme, jante, touvrant, climatisation, retroelectriques, vcentral, dassister, vitrelectrique, selectrique, airbagconduc, airbagpassager, ordibord, scuir, abs, autresoption, madame, mademoiselle, monsieur, nomprenom, particulier, professionnel, collaborateur, adresse, ville, pays, telephone, email ) VALUES ( '" . $radiok . "', '" .$radiocd . "', '" .$alarme. "', '" .$jante. "', '" .$touvrant. "', '" . $climatisation. "', '" .$retroelectriques. "', '" .$vcentral. "', '" .$dassister. "', '" . $vitrelectrique. "', '" .$selectrique. "' , '" .$airbagconduc. "', '" .$airbagpassager. "', '" .$ordibord. "', '" .$scuir. "', '" .$abs. "', '" .$autresoption. "', '" .$madame. "', '" .$mademoiselle. "', '" .$monsieur. "', '" .$nomprenom. "', '" .$particulier. "', '" .$professionnel. "', '" .$collaborateur. "', '" .$adresse. "', '" . $ville. "', '" . $pays. "', '" . $telephone. "', '" .$email. "')") or die(mysql_error());
echo '<center><p><b> Inscription complete <b></p></center> ';
echo '<center><p><b> <a href="depotannonce.php"> Postez une nouvelle annonce</a><b></p></center> ';
echo '<center><p><b> <a href="index.php">
Cliquez ici pour revenir l\'acceuil
</a><b></p></center> ';
}
mysql_close();
?> |