[PHP] Undefined index pour récup value
Résolu/Fermé
onaos
Messages postés
4
Date d'inscription
vendredi 16 février 2007
Statut
Membre
Dernière intervention
23 avril 2009
-
24 févr. 2009 à 10:51
MysticSquall Messages postés 401 Date d'inscription lundi 4 juillet 2005 Statut Membre Dernière intervention 7 octobre 2011 - 24 févr. 2009 à 14:27
MysticSquall Messages postés 401 Date d'inscription lundi 4 juillet 2005 Statut Membre Dernière intervention 7 octobre 2011 - 24 févr. 2009 à 14:27
A voir également:
- [PHP] Undefined index pour récup value
- Easy php - Télécharger - Divers Web & Internet
- Index téléphonique - Guide
- No index col - Forum Excel
- The input value is invalid. pdf ✓ - Forum Webmastering
- Excel : résultat multiple avec une rechercheV ✓ - Forum Excel
1 réponse
MysticSquall
Messages postés
401
Date d'inscription
lundi 4 juillet 2005
Statut
Membre
Dernière intervention
7 octobre 2011
27
24 févr. 2009 à 14:27
24 févr. 2009 à 14:27
if (isset($_POST['search']))
{
echo "<FORM method="POST" action="tapage.php">";
$requete = "SELECT * FROM $table WHERE name like '%".strtoupper(htmlentities($_POST['recherche']))."%';";
$resultat = mysql_query($requete);
//DÉBUT DE LA TABLE
echo "<table id='content'>";
//DÉBUT DE LA BOUCLE
while ($val = mysql_fetch_array($resultat))
{
echo"<tr>";
echo"<td><input name=\"test\" type='text' value=".$val['id']."></td>";
$test=trim($_POST['test']);
echo $test;
echo"<td><input name='nom' type='text' value=".$val['name']."></td>";
echo"<td><input name='prenom' type='text' value=".$val["username"]."></td>";
echo"<td><input name='anniversaire' type='text' value=".$val["bornday"]."></td>";
echo"<td><input name='adresse' type='text' value=".$val["adresse"]."></td>";
echo"<td><input name='nat' type='text' value=".$val["nat"]."></td>";
echo"<td>Licence payée : <input type='checkbox' name='valid' ";
if ($val['valid']==1)
{echo"checked";}
echo"></td>";
echo"<td>";
if (($val["valid"])==1)
{echo "<form><input type='submit' name='print' value='Print' onclick='imprimer()'></form>";}
elseif (($val["valid"])==0)
{echo "En cours";}
echo"</td>";
echo"</tr>";
}
//FIN DE LA BOUCLE
echo "</table>";
//FIN DE LA TABLE
tu rajoute un bouton mettre a jour avec un name="maj" par exemple
echo "</FORM>";
}
plus bas tu met
if (isset($_POST['maj'])){
$sql = "UPDATE matable SET nom =$_POST['nom'], champ2 = valeur2 ..ect WHERE identifiant = l'identifiant;
mysql_query($sql);
}
{
echo "<FORM method="POST" action="tapage.php">";
$requete = "SELECT * FROM $table WHERE name like '%".strtoupper(htmlentities($_POST['recherche']))."%';";
$resultat = mysql_query($requete);
//DÉBUT DE LA TABLE
echo "<table id='content'>";
//DÉBUT DE LA BOUCLE
while ($val = mysql_fetch_array($resultat))
{
echo"<tr>";
echo"<td><input name=\"test\" type='text' value=".$val['id']."></td>";
$test=trim($_POST['test']);
echo $test;
echo"<td><input name='nom' type='text' value=".$val['name']."></td>";
echo"<td><input name='prenom' type='text' value=".$val["username"]."></td>";
echo"<td><input name='anniversaire' type='text' value=".$val["bornday"]."></td>";
echo"<td><input name='adresse' type='text' value=".$val["adresse"]."></td>";
echo"<td><input name='nat' type='text' value=".$val["nat"]."></td>";
echo"<td>Licence payée : <input type='checkbox' name='valid' ";
if ($val['valid']==1)
{echo"checked";}
echo"></td>";
echo"<td>";
if (($val["valid"])==1)
{echo "<form><input type='submit' name='print' value='Print' onclick='imprimer()'></form>";}
elseif (($val["valid"])==0)
{echo "En cours";}
echo"</td>";
echo"</tr>";
}
//FIN DE LA BOUCLE
echo "</table>";
//FIN DE LA TABLE
tu rajoute un bouton mettre a jour avec un name="maj" par exemple
echo "</FORM>";
}
plus bas tu met
if (isset($_POST['maj'])){
$sql = "UPDATE matable SET nom =$_POST['nom'], champ2 = valeur2 ..ect WHERE identifiant = l'identifiant;
mysql_query($sql);
}