PHP
Résolu
Mayssa28
Messages postés
13
Date d'inscription
Statut
Membre
Dernière intervention
-
canarder Messages postés 1714 Date d'inscription Statut Membre Dernière intervention -
canarder Messages postés 1714 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
je suis debutante en php et je n'arrive pas à recuperer les valeur des champs dans le formulaire en utilisant $_post.
voila mon code
<html>
<head>
<a href="MenuPrincipal.html">Menu Principal</a><title></title></head>
<body>
<?
echo "<br> la liste des article <br>" ;
$con=mysql_connect("127.0.0.1","root","")or die (mysql_error());
mysql_select_db("base_stock")or die (mysql_error());
$r=mysql_query("select * from articles where prix >".$_GET['prixmin'] )or die (mysql_error());
/*pbleme recupere valeur champ*/
echo " <table border='1'><tr><td>id_art</td><td>Designation</td><td>Description</td><td>prix</td><td>dispo</td></tr>" ;
while($l=mysql_fetch_array($r)) {
echo"<tr bgcolor='pink'>";
echo "<td>$l[0]</td><td>$l[1]</td><td>$l[2]</td><td>$l[3]</td><td>$l[4]</td></tr>";
}
echo "</table>";
mysql_close($con);
?>
<form name="f1" method="GET" action="recherche.php">
<table border = 1>
<tr>
<td>nom article<input type="text" name="id" ></td><td><a href="actualise_art.php">actualiser </a></td>
</tr>
<tr>
<td> prix </td>
<td>prixmin<input type="text" name="prixmin" > prixmax<input type="text" name="prixmax" ></td>
</tr>
<tr>
<td><select name="sel">
<?php
$con=mysql_connect("127.0.0.1","root","")or die (mysql_error());
mysql_select_db("base_stock")or die (mysql_error());
$r=mysql_query("select * from categorie")or die (mysql_error());
while($l=mysql_fetch_array($r)) {
echo "<option value=".$l['id_cat'].">".$l['nom_cat'];
}?></select></td><td><input type="submit" value="rechercher">
</td></tr>
</table>
</form>
</body>
</html>
MERCI
je suis debutante en php et je n'arrive pas à recuperer les valeur des champs dans le formulaire en utilisant $_post.
voila mon code
<html>
<head>
<a href="MenuPrincipal.html">Menu Principal</a><title></title></head>
<body>
<?
echo "<br> la liste des article <br>" ;
$con=mysql_connect("127.0.0.1","root","")or die (mysql_error());
mysql_select_db("base_stock")or die (mysql_error());
$r=mysql_query("select * from articles where prix >".$_GET['prixmin'] )or die (mysql_error());
/*pbleme recupere valeur champ*/
echo " <table border='1'><tr><td>id_art</td><td>Designation</td><td>Description</td><td>prix</td><td>dispo</td></tr>" ;
while($l=mysql_fetch_array($r)) {
echo"<tr bgcolor='pink'>";
echo "<td>$l[0]</td><td>$l[1]</td><td>$l[2]</td><td>$l[3]</td><td>$l[4]</td></tr>";
}
echo "</table>";
mysql_close($con);
?>
<form name="f1" method="GET" action="recherche.php">
<table border = 1>
<tr>
<td>nom article<input type="text" name="id" ></td><td><a href="actualise_art.php">actualiser </a></td>
</tr>
<tr>
<td> prix </td>
<td>prixmin<input type="text" name="prixmin" > prixmax<input type="text" name="prixmax" ></td>
</tr>
<tr>
<td><select name="sel">
<?php
$con=mysql_connect("127.0.0.1","root","")or die (mysql_error());
mysql_select_db("base_stock")or die (mysql_error());
$r=mysql_query("select * from categorie")or die (mysql_error());
while($l=mysql_fetch_array($r)) {
echo "<option value=".$l['id_cat'].">".$l['nom_cat'];
}?></select></td><td><input type="submit" value="rechercher">
</td></tr>
</table>
</form>
</body>
</html>
MERCI
A voir également:
- 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
3 réponses
Remplaces tous les GET par POST et voila c'est pas plus complique que ca.
------------------------------------------------------
join us now and share the software
you'll be free hackers you'll be free
...
------------------------------------------------------
join us now and share the software
you'll be free hackers you'll be free
...