par
dunbar » 11 août 2006, 15:51
Bonjour,
J'ai un truc trés bizarre, j'ai un form dans lequelle j'utile une function
<?php echo "Bonjour, ".$user;?>
Cette variable est déclarer comme ceci
$user = $_SESSION['nom'];
Quand on arrive sur le formulaire c'est bien le nom de session qui va avec le login on valide et là si tout se passe bien il y à un message
<font size="4"><?php echo"Merci " .$user;?> pour une prestation supplémentaire merci de cliquez ici</font></a></b></p>
Il y à un lien sur cette page qui permet de revenir en arrière pour un nouvelle encodage, et si je clique sur le lien j'ai à la place du nom de la session j'ai le nom encoder dans le champs nom du formulaire précédent.
J'ai même renomer le champ (nom_client) mais cela ne change rien ou va t'il chercher cette information ??????
mes pages.
le formulaire :
<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: ../index.php');
exit();
}
$user = $_SESSION['nom'];
?>
<html>
<head>
<meta http-equiv="Content-Language" content="fr-be">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>VD-CABLING S.A</title>
</head>
<script language="javascript" src="tvc.js"></script>
<body background="../../img/grd-4px.gif">
<div align="center">
<table border="0" id="table1" width="935">
<tr>
<td align="center">
<p align="center"><font color="#0000FF" size="7">VD-CABLING
S.A</font></p>
</td>
</tr>
<tr>
<td align="left"><font size="2">Rue des Mineurs,15</font></td>
</tr>
<tr>
<td align="left"><font size="2">4610 Beyne-Heusey</font></td>
</tr>
<tr>
<td align="left"><font size="2">Tél : 04/362.37.77</font></td>
</tr>
</table>
</div>
<table border="0" id="table2" width="935">
<tr>
<td align="center">
<p align="center"><font size="4">Encodage des prestations
<font color="#FF0000">tvc</font>@ble<font color="#FF0000">net</font> du
jour.</font></p>
<?php echo "Bonjour, ".$user;?>
<p></p>
</td>
</tr>
</table>
<center>
<form method="POST" onsubmit="return check1()" name="prestations_tvc" action="../enregistrement/validation_tvc.php">
<table border="0" id="table5" width="931">
<tr>
<td width="453">
<font size="2">Date de l'installation :</font>
<input type="text" name="date_realisation[1]" value = '<? echo $today = date("Y-m-j") ?>' size="20" id="date_realisation[1]">
</td>
<td>
<p align="center">
<!--webbot bot="HTMLMarkup" startspan --><? $today = date (" Y-m-j");
echo "Nous sommes le". $today." ";
?><!--webbot bot="HTMLMarkup" endspan i-checksum="21062" --></p>
</td>
</tr>
</table>
<table border="0" id="table3" width="935" bgcolor="#C0C0C0" style="background-image: url('../../img/bg.gif')">
<tr>
<td width="69" align="center"><b><font size="1">Ref client</font></b></td>
<td width="248" align="center"><b><font size="1">Adresse client</font></b></td>
<td width="66" align="center"><font size="2">nom</font></td>
<td width="65" align="center"><b><font size="1">code postal</font></b></td>
<td width="71" align="center"><b><font size="1">Localité</font></b></td>
<td align="center"><b><font size="1">Adresse MAC</font></b></td>
</tr>
<tr>
<td width="69" align="center">
<input type="text" name="ref[1]" size="7" id="ref"></td>
<td width="248" align="center">
<input type="text" name="adr[1]" size="36" style="text-transform: capitalize" id="adr"></td>
<td width="66" align="center">
<p align="center">
<input type="text" name="nom_client[1]" size="12" style="text-transform: capitalize" id="nom_client"></p>
</td>
<td width="65" align="center">
<input type="text" name="postal[1]" size="6" id="postal"></td>
<td width="71" align="center">
<p align="center">
<input type="text" name="commune[1]" size="12" style="text-transform: capitalize" id="commune"></p>
</td>
et mon fichier validation
<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: ../index.php');
exit();
}
/*
Connexion à la base
*/
include "../../connect/fc-phpconnect_tvc.php";
/*
date
*/
$today = date("Y-m-j");
/*
Récupération des données de la première ligne.
*/
$date1 = mysql_real_escape_string (trim($_POST['date_realisation'][1]));
$date2 = $_today;
$user = $_SESSION['nom'];
$ref = mysql_real_escape_string (trim($_POST['ref'][1]));
$nom = mysql_real_escape_string (trim($_POST['nom_client'][1]));
$adr = mysql_real_escape_string (trim($_POST['adr'][1]));
$code = mysql_real_escape_string (trim($_POST['postal'][1]));
$commune = mysql_real_escape_string (trim($_POST['commune'][1]));
$address_mac = $_POST['mac'][1].":".$_POST['mac'][2].":".$_POST['mac'][3].":".$_POST['mac'][4].":".$_POST['mac'][5].":".$_POST['mac'][6] ;
$tech = mysql_real_escape_string (trim($_POST['technicien']));
$heure_debut = mysql_real_escape_string (trim($_POST['ha'][1].":".$_POST['ha'][2]));
$heure_fin = mysql_real_escape_string (trim($_POST['hd'][1].":".$_POST['hd'][2]));
$telephone = mysql_real_escape_string (trim($_POST['tel'][1]));
$installation = mysql_real_escape_string (trim($_POST['installation']));
$commentaire = mysql_real_escape_string (trim($_POST['com'][1]));
/**
Insertion dans la base de la ligne 1.
******/
$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, telephone,
etat_installation, commentaire)
values ( '".$date1."','".$date2."','".$user."','".$ref."',
'".ucfirst($nom)."','".ucfirst($adr)."','".$code."','".u
cfirst($commune)."','".strtoupper($ad
dress_mac)."', '".$tech."','".$heure_debut."','".$heure_fin."','"
.$telephone."','".$installation."','".ucfi
rst($commentaire)."')";
$insert = mysql_query($sql) or die (mysql_error());
mysql_close();
?>
<html>
<head>
</head>
<body>
<body background="../../img/grd-4px.gif">
Merci les informations sont enregistrées.
<p align="center"><b><a href="../prestations/vdcabling.php">
<font size="4"><?php echo"Merci " .$user;?> pour une prestation supplémentaire merci de cliquez ici</font></a></b></p>
<p><b><font color="#FF0000">
<a href="../deconnexion.php"><font color="#FF0000">Déconnexion</font></a>
</body>
</font>
</b>
</p>
</body>
</html>

C'est vraiment truc bizarre........
Détail important peut-être en local sous WAMP cela fonctionne mais sur mon serveur WEB il déconne
Modération : le copier coller c'est bien pour montrer son code, mais les lignes trop longues peuvent être raccourcies. Surtout quand ce sont les lignes de commentaaires (/**** ****/).
mere-teresa
Bonjour,
J'ai un truc trés bizarre, j'ai un form dans lequelle j'utile une function
[php]<?php echo "Bonjour, ".$user;?> [/php]
Cette variable est déclarer comme ceci
[php]$user = $_SESSION['nom'];[/php]
Quand on arrive sur le formulaire c'est bien le nom de session qui va avec le login on valide et là si tout se passe bien il y à un message
[php]<font size="4"><?php echo"Merci " .$user;?> pour une prestation supplémentaire merci de cliquez ici</font></a></b></p>[/php]
Il y à un lien sur cette page qui permet de revenir en arrière pour un nouvelle encodage, et si je clique sur le lien j'ai à la place du nom de la session j'ai le nom encoder dans le champs nom du formulaire précédent.
J'ai même renomer le champ (nom_client) mais cela ne change rien ou va t'il chercher cette information ??????
mes pages.
le formulaire :
[php]<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: ../index.php');
exit();
}
$user = $_SESSION['nom'];
?>
<html>
<head>
<meta http-equiv="Content-Language" content="fr-be">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>VD-CABLING S.A</title>
</head>
<script language="javascript" src="tvc.js"></script>
<body background="../../img/grd-4px.gif">
<div align="center">
<table border="0" id="table1" width="935">
<tr>
<td align="center">
<p align="center"><font color="#0000FF" size="7">VD-CABLING
S.A</font></p>
</td>
</tr>
<tr>
<td align="left"><font size="2">Rue des Mineurs,15</font></td>
</tr>
<tr>
<td align="left"><font size="2">4610 Beyne-Heusey</font></td>
</tr>
<tr>
<td align="left"><font size="2">Tél : 04/362.37.77</font></td>
</tr>
</table>
</div>
<table border="0" id="table2" width="935">
<tr>
<td align="center">
<p align="center"><font size="4">Encodage des prestations
<font color="#FF0000">tvc</font>@ble<font color="#FF0000">net</font> du
jour.</font></p>
<?php echo "Bonjour, ".$user;?>
<p></p>
</td>
</tr>
</table>
<center>
<form method="POST" onsubmit="return check1()" name="prestations_tvc" action="../enregistrement/validation_tvc.php">
<table border="0" id="table5" width="931">
<tr>
<td width="453">
<font size="2">Date de l'installation :</font>
<input type="text" name="date_realisation[1]" value = '<? echo $today = date("Y-m-j") ?>' size="20" id="date_realisation[1]">
</td>
<td>
<p align="center">
<!--webbot bot="HTMLMarkup" startspan --><? $today = date (" Y-m-j");
echo "Nous sommes le". $today." ";
?><!--webbot bot="HTMLMarkup" endspan i-checksum="21062" --></p>
</td>
</tr>
</table>
<table border="0" id="table3" width="935" bgcolor="#C0C0C0" style="background-image: url('../../img/bg.gif')">
<tr>
<td width="69" align="center"><b><font size="1">Ref client</font></b></td>
<td width="248" align="center"><b><font size="1">Adresse client</font></b></td>
<td width="66" align="center"><font size="2">nom</font></td>
<td width="65" align="center"><b><font size="1">code postal</font></b></td>
<td width="71" align="center"><b><font size="1">Localité</font></b></td>
<td align="center"><b><font size="1">Adresse MAC</font></b></td>
</tr>
<tr>
<td width="69" align="center">
<input type="text" name="ref[1]" size="7" id="ref"></td>
<td width="248" align="center">
<input type="text" name="adr[1]" size="36" style="text-transform: capitalize" id="adr"></td>
<td width="66" align="center">
<p align="center">
<input type="text" name="nom_client[1]" size="12" style="text-transform: capitalize" id="nom_client"></p>
</td>
<td width="65" align="center">
<input type="text" name="postal[1]" size="6" id="postal"></td>
<td width="71" align="center">
<p align="center">
<input type="text" name="commune[1]" size="12" style="text-transform: capitalize" id="commune"></p>
</td>
[/php]
et mon fichier validation
[php]
<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: ../index.php');
exit();
}
/*
Connexion à la base
*/
include "../../connect/fc-phpconnect_tvc.php";
/*
date
*/
$today = date("Y-m-j");
/*
Récupération des données de la première ligne.
*/
$date1 = mysql_real_escape_string (trim($_POST['date_realisation'][1]));
$date2 = $_today;
$user = $_SESSION['nom'];
$ref = mysql_real_escape_string (trim($_POST['ref'][1]));
$nom = mysql_real_escape_string (trim($_POST['nom_client'][1]));
$adr = mysql_real_escape_string (trim($_POST['adr'][1]));
$code = mysql_real_escape_string (trim($_POST['postal'][1]));
$commune = mysql_real_escape_string (trim($_POST['commune'][1]));
$address_mac = $_POST['mac'][1].":".$_POST['mac'][2].":".$_POST['mac'][3].":".$_POST['mac'][4].":".$_POST['mac'][5].":".$_POST['mac'][6] ;
$tech = mysql_real_escape_string (trim($_POST['technicien']));
$heure_debut = mysql_real_escape_string (trim($_POST['ha'][1].":".$_POST['ha'][2]));
$heure_fin = mysql_real_escape_string (trim($_POST['hd'][1].":".$_POST['hd'][2]));
$telephone = mysql_real_escape_string (trim($_POST['tel'][1]));
$installation = mysql_real_escape_string (trim($_POST['installation']));
$commentaire = mysql_real_escape_string (trim($_POST['com'][1]));
/**
Insertion dans la base de la ligne 1.
******/
$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, telephone,
etat_installation, commentaire)
values ( '".$date1."','".$date2."','".$user."','".$ref."',
'".ucfirst($nom)."','".ucfirst($adr)."','".$code."','".u
cfirst($commune)."','".strtoupper($ad
dress_mac)."', '".$tech."','".$heure_debut."','".$heure_fin."','"
.$telephone."','".$installation."','".ucfi
rst($commentaire)."')";
$insert = mysql_query($sql) or die (mysql_error());
mysql_close();
?>
<html>
<head>
</head>
<body>
<body background="../../img/grd-4px.gif">
Merci les informations sont enregistrées.
<p align="center"><b><a href="../prestations/vdcabling.php">
<font size="4"><?php echo"Merci " .$user;?> pour une prestation supplémentaire merci de cliquez ici</font></a></b></p>
<p><b><font color="#FF0000">
<a href="../deconnexion.php"><font color="#FF0000">Déconnexion</font></a>
</body>
</font>
</b>
</p>
</body>
</html>[/php]
:twisted: C'est vraiment truc bizarre........
Détail important peut-être en local sous WAMP cela fonctionne mais sur mon serveur WEB il déconne
[color=red]Modération : le copier coller c'est bien pour montrer son code, mais les lignes trop longues peuvent être raccourcies. Surtout quand ce sont les lignes de commentaaires (/**** ****/).
mere-teresa[/color]