A voir également:
- Probleme avec php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Bouton php - Forum PHP
- \R php ✓ - Forum PHP
- Php alert - Forum PHP
1 réponse
ScroudaF
Messages postés
121
Date d'inscription
samedi 8 juillet 2006
Statut
Membre
Dernière intervention
11 octobre 2011
11
24 mai 2008 à 13:43
24 mai 2008 à 13:43
$$_POST['id_obj']
Il y a un $ de trop peut-être?
Je n'ai pas bien compris ton problème...
Il y a un $ de trop peut-être?
Je n'ai pas bien compris ton problème...
24 mai 2008 à 13:51
C'est un site de vente au enchere, en face de chaque ligne il y a une case a remplir avec un bouton enregistrer pour réencherir.Le probleme c'est qu'il ne sait pas quel objet je réenchri.
voila ce que j'ai écrit:
$_SESSION['idf']='dupoma250';
?>
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>ENCHERE EN COURS</title>
<link href="mise en forme enchere en cours.css" rel="stylesheet"type="text/css"/>
</head>
<body>
<div id="titre"> L'ATR : acheter, vender c'est pas compliqué </div>
<div id="cadre">
<div id="liste"> Les encheres en cours </div>
<?php
$maconnexion= mysql_connect('localhost', 'root', '');
mysql_select_db('projet2');
?>
<table>
<tr >
<th scope="col">objet</th>
<th scope="col">id objet</th>
<th scope="col">description objet</th>
<th scope="col">nom étudiant</th>
<th scope="col">promotion</th>
<th scope="col">fin enchère</th>
<th scope="col">date enchere</th>
<th scope="col">prix début</th>
<th scope="col">prix proposé</th>
<th scope="col">proposé une enchère</th>
</tr>
<?php
$resultat = mysql_query("SELECT nom_obj,ref_objet,nom_etud,Ref_etudiant,id_obj,descriptif_obj,fin_ench,date_enchere,promo_etud,prix_debut,MAX( prix_propose ) AS prix_propose FROM (enchere RIGHT JOIN objet ON ref_objet = id_obj) LEFT JOIN etudiants ON Ref_etudiant = identifiant GROUP BY nom_obj");
while($ligne = mysql_fetch_array($resultat))
{
?>
<form id="form4" name="form4" method="POST" action="feuille 4 1projet web.php">
<tr class="ligne<?php echo $i;?>">
<td><?php echo $ligne['nom_obj'];?></td>
<td><?php echo $ligne['id_obj']?></td>
<td><?php echo $ligne['descriptif_obj'];?></td>
<td><?php echo $ligne['nom_etud'];?></td>
<td><?php echo $ligne['promo_etud'];?></td>
<td><?php echo $ligne['fin_ench'];?></td>
<td><?php echo $ligne['date_enchere'];?></td>
<td><?php echo $ligne['prix_debut'];?> €</td>
<td><?php echo $ligne['prix_propose'];?> €</td>
<td><input type="text" name="propose_prix" id="propose_prix"/></td>
<td><input type="hidden" value=" <?php $ligne['id_obj'] ?>" name="ref_obj"><input type="hidden" value="<?php echo $ligne['MAX( prix_propose )']?>" name="prixmax"><input type="submit" name="valider" id="valider" value="enregister"/></td>
</tr>
</form>
<?php }
if(isset($_POST['propose_prix']))
{if($_POST['propose_prix']>$_POST['MAX( prix_propose )'])
{
$sql="INSERT INTO enchere(Ref_etudiant,ref_objet,date_enchere,prix_propose)VALUE
('".$_SESSION['idf']."', '".$_POST['id_obj']."','".Date("Y-m-d-G")."','".$_POST['propose_prix']."')" ;
$req = mysql_query($sql);
echo" Votre enchere a bien ete enregistree"; ?> <br/> <?php
}
else
{
echo"miser plus";
}}
?>
</table>
</body>
</html>