Probleme en php
Hacker#1
Messages postés
76
Date d'inscription
Statut
Membre
Dernière intervention
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour,
Quand je clique sur le bouton envoyer dans la page modifier nbre.php j'ai le message suivant
modifier nbre.php
modifierlivre.php
Quand je clique sur le bouton envoyer dans la page modifier nbre.php j'ai le message suivant
Notice: Undefined index: n in C:\wamp\www\compte\modifier nbre.php on line 21
modifier nbre.php
<html> <style type="text/css"> <!-- .style1 {font-family: Arial} --> </style> <body> <form action="modifier nbre.php" method="post"> <table width="348" border="0" cellpadding="3"> <tr> <td width="167"><span class="style1">Nombre d'exemplaire</span></td> <td width="163"><input type="text" name="nbre"></td> </tr> </table> <input type="submit" name="sub" value="envoyer"> </label> </p> </form> <?php if(isset($_POST["sub"])) {$a=$_GET["n"]; $d=$_POST["nbre"]; $base=mysql_connect('localhost','root',''); mysql_select_db('compte'); mysql_query("update livre set `nbre d exemplaire`='$d' where nom='$a'"); } ?> </body> </html>
modifierlivre.php
<html> <style type="text/css"> <!-- .style1 {font-family: Arial} --> </style> <body> <p> <a href="frame.php" class="style1">Retour</a> <p> <?php $base=mysql_connect('localhost','root',''); mysql_select_db('compte'); $sql='SELECT * FROM livre'; $req=mysql_query($sql) or die('Erreur SQL!<br>'.$sql.'<br>'.mysql_error()); echo "<table border='0' cellpadding='3' width='507' align='center'> <tr> <th><span class='style1'>Nom</span></th> <th><span class='style1'>Auteur</span></th> <th><span class='style1'>Editeur</span></th> <th><span class='style1'>Nbre exemplaire</span></th> <th><span class='style1'>Image</span></th> <th></th></tr> <tr>"; while($data=mysql_fetch_array($req)) {$a=$data["nom"]; $b=$data["auteur"]; $c=$data["maison d edition"]; echo " <td><span class='style1'>".$data['nom']."</span></td> <td><span class='style1'>".$data['auteur']."</span></td> <td><span class='style1'>".$data['maison d edition']."</span></td> <td><span class='style1'>".$data['nbre d exemplaire']."<br> <a href='modifier nbre.php?n=$a'>Modifier</a></span></td> <td><span class='style1'><img src=".$data['img']." width='75' height='115'/> <br><a href='modifier img.php?name=$a&&writer=$b&&editor=$c'>Modifier</a></span></td> <td><span class='style1'><a href='#'>Supprimer</a></span></td> </tr>"; } echo"</table>"; mysql_free_result($req); mysql_close(); ?> <p> </p> </body> </html>
A voir également:
- Probleme en php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php - Forum Webmastering
- Alert php - Forum PHP
- Retour a la ligne php ✓ - Forum PHP