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
| // SQL : Ajout du nouveau inventaire_server
$sql = "INSERT INTO inventaire_server VALUES ( '',
'" . strtoupper(presVar($_POST, 'inventaire_server_hostname')) . "',
'" . presVar($_POST, 'inventaire_server_ip') . "',
'" . strtoupper(presVar($_POST, 'inventaire_server_numero_serie')) . "',
'" . presVar($_POST, 'modele') . "',
'" . presVar($_POST, 'inventaire_server_id_os') . "',
'" . presVar($_POST, 'inventaire_server_type') . "',
'" . presVar($_POST, 'inventaire_server_mise_service') . "',
'" . presVar($_POST, 'inventaire_server_id_situation') . "',
'" . presVar($_POST, 'inventaire_server_date_reception') . "',
'" . presVar($_POST, 'inventaire_server_numero_reception') . "',
'" . presVar($_POST, 'inventaire_server_id_batiment') . "',
'" . presVar($_POST, 'inventaire_server_id_etage') . "',
'" . ucfirst(presVar($_POST, 'inventaire_server_commentaire_server')) . "',
'" . presVar($_POST, 'inventaire_server_id_contrat_maintenance') . "',
'" . presVar($_POST, 'inventaire_server_contrat_date_du') . "',
'" . presVar($_POST, 'inventaire_server_contrat_date_au') . "',
'" . ucfirst(presVar($_POST, 'inventaire_server_responsable_appli_prenom')) . "',
'" . NumTel(presVar($_POST, 'inventaire_server_responsable_appli_tel')) . "',
'" . strtoupper(presVar($_POST, 'inventaire_server_responsable_appli_nom')) . "',
'" . presVar($_POST, 'prenom') . "')";
//Sécuriter pour éviter les injection SQL
mysql_real_escape_string($sql);
//Execution de la requete
mysql_query($sql)or die(mysql_error()); |
Partager