le 21/11/2007 à 18:16
Forum - Problème pour l'insertion du sujet en gardant la catégorie correspondante
personne ne connais la réponse?
mysql_query("UPDATE fiche_membres SET genre, logiciel, presentation WHERE login='".$_SESSION['login']."'");
mysql_query("UPDATE fiche_membres SET('', '" . $_SESSION['login'] . "', '" . $genre . "', '" . $logiciel . "', '" . $presentation . "') WHERE ('" . $_SESSION['login'] . "')");mysql_query("INSERT INTO fiche_membres VALUES('', '" . $_SESSION['login'] . "', '" . $genre . "', '" . $logiciel . "', '" . $presentation . "')");
mysql_query("INSERT INTO fiche_membres VALUES('', '". $_SESSION['id'] ."', '" . $genre . "', '" . $presentation . "', '" . $logiciel . "')");<?php
session_start();
if (!isset($_SESSION['login'])) {
header ('Location: index.php');
exit();
}
?>
<? if (isset($_POST['genre']) AND isset($_POST['presentation']) AND isset($_POST['logiciel'])) // Si les variables existent
{
if ($_POST['genre'] != NULL AND $_POST['presentation'] != NULL AND $_POST['logiciel'] != NULL) // Si on a quelque chose à enregistrer
{
// Maintenant on doit récupérer les entrées de la table
// On se connecte d'abord à MySQL :
mysql_connect("db160.1and1.fr", "dbo207806785", "2tHjd9g2");
mysql_select_db("db207806785");
$genre = mysql_real_escape_string(htmlspecialchars($_POST['genre']));
$presentation = mysql_real_escape_string(htmlspecialchars($_POST['presentation']));
$logiciel = mysql_real_escape_string(htmlspecialchars($_POST['logiciel']));
// Ensuite on enregistre le message
mysql_query("INSERT INTO fiche_membres VALUES('', '". $_SESSION['id'] ."', '" . $genre . "', '" . $presentation . "', '" . $logiciel . "')");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Fiche membre</title>
<style type="text/css">
<!--
.Style1 {
font-family: Verdana;
font-size: 12px;
}
-->
</style>
</head>
<body>
<?php
mysql_connect("db160.1and1.fr", "dbo207806785", "2tHjd9g2"); // Connexion à MySQL
mysql_select_db("db207806785"); // Sélection de la base coursphp
$reponse = mysql_query("SELECT id_membre, genre, logiciel, presentation, FROM fiche_membres"); // Requête SQL
$donnees = mysql_fetch_array($reponse);
?>
<p class="Style1"><a href="http://www.djworld.fr/espacemembre/membre.php">Retour à la page d'accueil de la jukebox </a></p>
<p class="Style1">Vous voici sur votre fiche membre :</p>
<p class="Style1"> </p>
<table width="690" height="430" border="" align="center">
<tr>
<td width="34%" height="40" rowspan="4"><div align="center">PHOTO MEMBRE </div></td>
<td width="23%" height="40">Pseudo : </td>
<td width="43%"><?php echo htmlentities(stripslashes(trim($_SESSION['login']))); ?></td>
</tr>
<tr>
<td height="40">Mot de passe : </td>
<td>*************</td>
</tr>
<tr>
<td height="40">Quel genre de musique aimez-vous? </td>
<td height="40"><? echo $donnees['genre']; ?></td>
</tr>
<tr>
<td height="56">Quels logiciels utilisez vous? </td>
<td height="56"><? echo $donnees['logiciel']; ?></td>
</tr>
<tr>
<td height="137" colspan="3" valign="top"><p>Votre histoire : </p>
<? echo $donnees['presentation']; ?> </td>
</tr>
<tr>
<td colspan="3" valign="top"><p>Liste des dernières compos ajoutées à la jukebox : </p>
<p> </p>
<p> </p></td>
</tr>
</table>
<p align="center" class="Style1"><a href="modif_fiche_membre.php">Modifier vos données</a> </p>
<p class="Style1"><a href="http://www.djworld.fr/espacemembre/membre.php">Retour à la page d'accueil de la jukebox </a></p>
</body>
</html>
<?php
mysql_close(); // Déconnexion de MySQL
?>
Chargement en cours