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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php $NumCommune=$_GET["NumCommune"]; ?>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php require ('connexion2.php');
$NomCommune = strtoupper($_POST["NomCommune"]);
$NomCommune = str_replace($NomCommune,"'","''");
$Departement = $_POST["Departement"];
$SuperficieCne = $_POST["SuperficieCne"];
$Population = $_POST["Population"];
$Maire = $_POST["Maire"];
$Insee = $_POST["Insee"];
$Pays = $_POST["Pays"];
$NomCmteCnes = $_POST["NomCmteCnes"];
$NomCmteAgglo = $_POST["NomCmteAgglo"];
$NomCmteUrb = $_POST["NomCmteUrb"];
if($NumCommune==0){
$Req = "Insert into commune(NomCommune,Departement,SuperficieCne,Population,Maire,Insee,Pays,NomCmteCnes,NomCmteAgglo,NomCmteUrb) ";
$Req = $Req."values ('".$NomCommune."','".$Departement."','".$SuperficieCne."','".$Population."','".$Maire."','".$Insee."','".$Pays."',";
$Req = $Req."'".$NomCmteCnes."','".$NomCmteAgglo."','".$NomCmteUrb."')";}
else {
$Req = "Update commune set (SuperficieCne= '".$SuperficieCne."',Population= '".$Population."',Maire= '".$Maire."',Insee= '".$Insee."',Pays= '".$Pays."',";
$Req = $Req."NomCmteCnes= '".$NomCmteCmes."',NomCmteAgglo= '".$NomCmteAgglo."',NomCmteUrb= '".$NomCmteUrb."')";}
mysql_db_query("zppaup",$Req)or die (mysql_error());
mysql_close($cnx);
header('Location:commune.php');
exit;
?>
</body>
</html> |