par
dunbar » 10 août 2006, 22:47
Ok merci j'ai trouvé
Voici mon fichier finie et qui fonctionne
<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: ../index.php');
exit();
}
/******************************************************************************************************************************************************
Connexion à la base
******************************************************************************************************************************************************/
include "../../connect/fc-phpconnect.php";
/*****************************************************************************************************************************************************
Récupération des données de la première ligne.
*****************************************************************************************************************************************************/
$date1 = $_POST['date_realisation'][1];
$date2 = $_POST['date_encodage'][2];
$user = $_SESSION['nom'];
$ref = $_POST['ref'][1];
$nom = $_POST['nom'][1];
$adr = $_POST['adr'][1];
$code = $_POST['postal'][1];
$commune = $_POST['commune'][1];
$address_mac = $_POST['mac'][1].":".$_POST['mac'][2].":".$_POST['mac'][3].":".$_POST['mac'][4].":".$_POST['mac'][5].":".$_POST['mac'][6] ;
$tech = $_POST['technicien'];
$heure_debut = $_POST['ha'][1].":".$_POST['ha'][2];
$heure_fin = $_POST['hd'][1].":".$_POST['hd'][1];
$installation = $_POST['installation'];
$commentaire = $_POST['com'][1];
/*****************************************************************************************************************************************************
Insertion dans la base de la ligne 2.
*****************************************************************************************************************************************************/
$sql = "INSERT INTO prestation_beta (date_realisation, date_encodage, nom_utilisateur, ref_client, nom_client, adr_client, code_postal, commune, adr_modem, technicien, heure_debut, heure_fin, etat_installation, commentaire) values ( '".$date1."','".$date2."','".$user."','".$ref."','".$nom."','".$adr."','".$code."','".$commune."','".$address_mac."', '".$tech."','".$heure_debut."','".$heure_fin."','".$installation."','".$commentaire."')";
$insert = mysql_query($sql) or die (mysql_error());
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<body background="../../img/grd-4px.gif">
<?php
echo "Merci les informations sont enregistrées.";
?>
<a href="../deconnexion.php"><font color="#FF0000">Déconnexion</font></a>
</body>
</html>
Je suis ouvert à toutes remarques

Et j'aurais encore une question ceci concerne une seule ligne de mon form mais j'ai besoin de 5 lignes en plus alors je comptais faire ceci 5x
$date1 = $_POST['date_realisation'][3];
$date2[2] = $_POST['date_encodage'][4];
$user = $_SESSION['nom'];
$ref[2] = $_POST['ref'][2];
$nom[2] = $_POST['nom'][2];
$adr[2] = $_POST['adr'][2];
$code[2] = $_POST['postal'][2];
$commune[2] = $_POST['commune'][2];
$address_mac[2] = $_POST['mac'][7].":".$_POST['mac'][8].":".$_POST['mac'][9].":".$_POST['mac'][10].":".$_POST['mac'][11].":".$_POST['mac'][12] ;
$tech = $_POST['technicien'];
$heure_debut[2] = $_POST['ha'][3].":".$_POST['ha'][4];
$heure_fin[2] = $_POST['hd'][5].":".$_POST['hd'][6];
$installation = $_POST['installation'];
$commentaire[2] = $_POST['com'][2];
/*****************************************************************************************************************************************************
Insertion dans la base de la ligne 2.
*****************************************************************************************************************************************************/
$sql = "INSERT INTO prestation_beta (date_realisation, date_encodage, nom_utilisateur, ref_client, nom_client, adr_client, code_postal, commune, adr_modem, technicien, heure_debut, heure_fin, etat_installation, commentaire) values ( '".$date1."','".$date2."','".$user."','".$ref[2]."','".$nom[2]."','".$adr[2]."','".$code[2]."','".$commune[2]."','".$address_mac[2]."', '".$tech."','".$heure_debut."','".$heure_fin."','".$installation."','".$commentaire[2]."')";
$insert = mysql_query($sql) or die (mysql_error());
?>
Et ainsi de suite pour les 4 autres mais je ne suis pas certain que cela est la meilleurs solution....
Ok merci j'ai trouvé
Voici mon fichier finie et qui fonctionne :lol:
[php]<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: ../index.php');
exit();
}
/******************************************************************************************************************************************************
Connexion à la base
******************************************************************************************************************************************************/
include "../../connect/fc-phpconnect.php";
/*****************************************************************************************************************************************************
Récupération des données de la première ligne.
*****************************************************************************************************************************************************/
$date1 = $_POST['date_realisation'][1];
$date2 = $_POST['date_encodage'][2];
$user = $_SESSION['nom'];
$ref = $_POST['ref'][1];
$nom = $_POST['nom'][1];
$adr = $_POST['adr'][1];
$code = $_POST['postal'][1];
$commune = $_POST['commune'][1];
$address_mac = $_POST['mac'][1].":".$_POST['mac'][2].":".$_POST['mac'][3].":".$_POST['mac'][4].":".$_POST['mac'][5].":".$_POST['mac'][6] ;
$tech = $_POST['technicien'];
$heure_debut = $_POST['ha'][1].":".$_POST['ha'][2];
$heure_fin = $_POST['hd'][1].":".$_POST['hd'][1];
$installation = $_POST['installation'];
$commentaire = $_POST['com'][1];
/*****************************************************************************************************************************************************
Insertion dans la base de la ligne 2.
*****************************************************************************************************************************************************/
$sql = "INSERT INTO prestation_beta (date_realisation, date_encodage, nom_utilisateur, ref_client, nom_client, adr_client, code_postal, commune, adr_modem, technicien, heure_debut, heure_fin, etat_installation, commentaire) values ( '".$date1."','".$date2."','".$user."','".$ref."','".$nom."','".$adr."','".$code."','".$commune."','".$address_mac."', '".$tech."','".$heure_debut."','".$heure_fin."','".$installation."','".$commentaire."')";
$insert = mysql_query($sql) or die (mysql_error());
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<body background="../../img/grd-4px.gif">
<?php
echo "Merci les informations sont enregistrées.";
?>
<a href="../deconnexion.php"><font color="#FF0000">Déconnexion</font></a>
</body>
</html>[/php]
Je suis ouvert à toutes remarques :wink:
Et j'aurais encore une question ceci concerne une seule ligne de mon form mais j'ai besoin de 5 lignes en plus alors je comptais faire ceci 5x
[php]$date1 = $_POST['date_realisation'][3];
$date2[2] = $_POST['date_encodage'][4];
$user = $_SESSION['nom'];
$ref[2] = $_POST['ref'][2];
$nom[2] = $_POST['nom'][2];
$adr[2] = $_POST['adr'][2];
$code[2] = $_POST['postal'][2];
$commune[2] = $_POST['commune'][2];
$address_mac[2] = $_POST['mac'][7].":".$_POST['mac'][8].":".$_POST['mac'][9].":".$_POST['mac'][10].":".$_POST['mac'][11].":".$_POST['mac'][12] ;
$tech = $_POST['technicien'];
$heure_debut[2] = $_POST['ha'][3].":".$_POST['ha'][4];
$heure_fin[2] = $_POST['hd'][5].":".$_POST['hd'][6];
$installation = $_POST['installation'];
$commentaire[2] = $_POST['com'][2];
/*****************************************************************************************************************************************************
Insertion dans la base de la ligne 2.
*****************************************************************************************************************************************************/
$sql = "INSERT INTO prestation_beta (date_realisation, date_encodage, nom_utilisateur, ref_client, nom_client, adr_client, code_postal, commune, adr_modem, technicien, heure_debut, heure_fin, etat_installation, commentaire) values ( '".$date1."','".$date2."','".$user."','".$ref[2]."','".$nom[2]."','".$adr[2]."','".$code[2]."','".$commune[2]."','".$address_mac[2]."', '".$tech."','".$heure_debut."','".$heure_fin."','".$installation."','".$commentaire[2]."')";
$insert = mysql_query($sql) or die (mysql_error());
?>
[/php]
Et ainsi de suite pour les 4 autres mais je ne suis pas certain que cela est la meilleurs solution....