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
|
<?php
$montant_tot=$_GET['total'];
$frais=$_GET['frais'];
if (isset($_POST['commander']))
{
if ((!empty($_POST['nom']))&& (!empty($_POST['prenom'])) && (!empty($_POST['tel']))&& (!empty($_POST['adresse'])) && (!empty($_POST['email'])) && (!empty($_POST['ville'])) && (!empty($_POST['civilite'])) &&(!empty($_POST['codep'])) && (!empty($_POST['societe'])))
{
$nom=$_POST['nom'];
$prenom=$_POST['prenom'];
$tel=$_POST['tel'];
$adr=$_POST['adresse'];
$email=$_POST['email'];
$ville=$_POST['ville'];
$civilite=$_POST['civilite'];
$codep=$_POST['codep'];
$societe=$_POST['societe'];
include ("connexion.php");
$req="insert into commande (nom_clt, prenom_clt, adresse_livraison, tel, email, ville, civilite, code_postale, societe, montant_tot, frais_trspt) values ( '$nom', '$prenom', '$adr', '$tel', '$email','$ville','$civilite', '$codep', '$societe', '$montant_tot', '$frais')";
$res=mysql_query ($req);
if ($res)
{
echo "<script> alert ('operation reussite');</script>";
}
}
else
{
echo "<script> alert ('Merci de saisir les champs obligatoires !!');</script>";
}
}
?> |
Partager