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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| <?php
$nb = $_POST['nbtrans'];
// on se connecte à MySQL
// on sélectionne la base
// on crée la requête SQL
$sql = "SELECT nombre, nomdupro, lienimage, liensite, longueur, hauteur, type FROM mediation WHERE nombre='".$nb."'";
// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$nbreLignes = mysql_num_rows($req);
if(!($nbreLignes ==0)){
// on fait une boucle qui va faire un tour pour chaque enregistrement
while($data = mysql_fetch_assoc($req))
{
// on affiche les informations de l'enregistrement en cours
echo '<form method="post" action="updatePro.php" ><p align="center"><a href="', $data['liensite'],'"><img src="', $data['lienimage'],'" width="', $data['longueur'],'" height="', $data['hauteur'],'"></a></p> <table width="460" align="center">
<tr><td>Nom</td><td align="center" width="250" valign="center" ><font color="#091243" face="Times New Roman" front-weighy="bold"><span
style="font-size: 14pt;"><b> <input type="text" name="nomdupro" value=\'',$data['nomdupro'],'\' size="20"></b></span></font> </td></tr>
<tr><td>Lien site</td><td align="center" width="250" valign="center" ><font color="#091243" face="Times New Roman" front-weighy="bold"><span
style="font-size: 14pt;"><b> <input type="text" name="liensite" value=\'',$data['liensite'],'\' size="20"></b></span></font> </td></tr>
<tr><td>Lien Image</td><td align="center" width="250" valign="center" ><font color="#091243" face="Times New Roman" front-weighy="bold"><span
style="font-size: 14pt;"><b> <input type="text" name="lienimage" value=\'',$data['lienimage'],'\' size="20"></b></span></font> </td></tr>
<tr><td>Longueur (px)</td><td align="center" width="250" valign="center" ><font color="#091243" face="Times New Roman" front-weighy="bold"><span
style="font-size: 14pt;"><b> <input type="text" name="longueur" value=\'',$data['longueur'],'\' size="20"></b></span></font> </td></tr>
<tr><td>Hauteur (px)</td><td align="center" width="250" valign="center" ><font color="#091243" face="Times New Roman" front-weighy="bold"><span
style="font-size: 14pt;"><b> <input type="text" name="hauteur" value=\'',$data['hauteur'],'\' size="20"></b></span></font> </td></tr>
<tr><td>Type (c pour cybermarchand, f pour FAI, t pour téléphonie)</td><td align="center" width="250" valign="center" ><font color="#091243" face="Times New Roman" front-weighy="bold"><span
style="font-size: 14pt;"><b> <input type="text" name="type" value=\'',$data['type'],'\' size="20"></b></span></font> </td></tr>
</tr> <table align="center">
<tr><td height="30" align="center" valign="bottom"><input type="submit" value="Valider modification" name="envoyer"><input type="hidden" name=nbtrans value=', $data['nombre'],' size="12"></form></td></tr>
</table>';
}
}
else{
echo '<p> Erreur : Requete SQL non effectuée. Merci de contacter le webmaster. </p>';
}
// on ferme la connexion à mysql
mysql_close();
?> |