par Vince Cotta » 16 mars 2012, 20:27
par Vince COTTA » 15 mars 2012, 16:33
<?php session_start(); if(empty($_SESSION['membre'])) { header('Location: terre.php'); } try { $bdd= new PDO('mysql:host=localhost;dbname=croizad', 'root', '') or die(print_r($bdd->errorInfo())); $bdd->exec('SET NAMES utf8'); } catch(Exeption $e){ die('Erreur:'.$e->getMessage()); } if(!empty($_POST)) { extract($_POST); $valid = true; } else { $valid=false; } if($valid) { $req = $bdd->prepare('UPDATE membre SET manifeste=:manifeste) WHERE login= '.$_SESSION['membre'].''); $req->execute(array('manifeste'=>$manifeste)); $req->closeCursor(); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link href="style.css" rel="stylesheet"/> <title> CROIZAD - Chacun sa croix</title> <?php include("bann.php"); ?> <?php include("menu.php"); ?> </head> <body> <div class="titre">Profil de <?php echo $_SESSION['membre'];?></div> <br/> <section> <div id="contenu"> <?php include("menu-membre.php"); ?> <br/> <div class="profil2"> <form class="form" action="manifeste.php" method="post"> <fieldset> <legend>Manifeste</legend> <br/> <label for="manifeste">Ecrivez votre texte ici:</label> <textarea class="label" name="manifeste" id="manifeste" rows=10 cols=40></textarea><br/> <br/> <input class="submit" type="submit" value="Ecrire"> <br/> </fieldset> </form> </div> </div> <br/> <br/> <?php $req = $bdd->prepare('SELECT * FROM membre WHERE login = '.$_SESSION['membre'].'')->fetchColumn();?> <div class="manifeste"> <?php echo $req ?> <h3><?php if(isset($_SESSION['membre'])) {echo $_SESSION['membre'];} ?></h3> <br/> <p><?php if(isset($data['manifeste'])) {echo $_SESSION['manifeste'];} ?></p> </div> <br/> </div> </section> <?php include("footer.php"); ?> </body> </html>
par moogli » 15 mars 2012, 07:53
Salut, Pour vérifier l'existence du pseudo dans la base, je te conseille d'utilisé Ajax c'est plus pratique, professionnel et évite a l'utilisateur de rechargé la page inutilement juste pour luis dire que le pseudo qu'il a choisi
par libertux » 14 mars 2012, 20:34
par Vince COTTA » 14 mars 2012, 18:56
par libertux » 14 mars 2012, 18:38
... if($valid) { $req = $bdd->prepare('UPDATE membre SET (text=:text)'); $req->execute(array('text'=>$text)); $req->closeCursor(); } ...
... if($valid) { $req = $bdd->prepare('UPDATE membre SET (text=:text) where id='.$_SESSION['id']); $req->execute(array('text'=>$text)); $req->closeCursor(); } ...
par xTG » 13 mars 2012, 20:36
par Vince COTTA » 13 mars 2012, 20:28
<?php session_start(); if(empty($_SESSION['membre'])) { header('Location: terre.php'); } try { $bdd= new PDO('mysql:host=localhost;dbname=croizad', 'root', '') or die(print_r($bdd->errorInfo())); $bdd->exec('SET NAMES utf8'); } catch(Exeption $e){ die('Erreur:'.$e->getMessage()); } if(!empty($_POST)) { extract($_POST); $valid = true; } else { $valid=false; } if($valid) { $req = $bdd->prepare('UPDATE membre SET (text=:text)'); $req->execute(array('text'=>$text)); $req->closeCursor(); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link href="style.css" rel="stylesheet"/> <title> CROIZAD - Chacun sa croix</title> <?php include("bann.php"); ?> <?php include("menu.php"); ?> </head> <body> <div class="titre">Profil de <?php echo $_SESSION['membre'];?></div> <br/> <section> <br/> <div id="contenu"> <ul class="profil"> <li><a href="profil.php">Informations</a></li> <li><a href="profil1.php">Editer E-m@il|Mot de Passe</a></li> <li><a href="manifeste.php">Manifeste</a></li> <li><a href="ajout.php">Ajouter infos</a></li> </ul> <div class="profil2"> <form action="manifeste.php" method="post"> <fieldset> <label for="text">Manifeste</label><br/> <textarea name="text" id="text" rows=10 cols=40></textarea><br/> <br/> <input type="submit" value="Ecrire"> <br/> </fieldset> </form> </div> </div> <br/> <br/> <?php $req = $bdd->prepare('SELECT * FROM membre WHERE login = '.$_SESSION['membre'].'')->fetchColumn();?> <div class="manifeste"> <?php echo $req ?> <h3><?php if(isset($_SESSION['membre'])) {echo $_SESSION['membre'];} ?></h3> <br/> <p><?php if(isset($data['text'])) {echo $_SESSION['text'];} ?></p> </div> <br/> </div> </section> <?php include("footer.php"); ?> </body> </html>
par xTG » 13 mars 2012, 19:33
$mot = 'test'; $phrase = 'Ceci est un ' . $mot . ' de concaténation.';
par Vince COTTA » 13 mars 2012, 19:31
par xTG » 13 mars 2012, 18:52
par Vince COTTA » 13 mars 2012, 18:50
par Vince COTTA » 13 mars 2012, 18:30
par Vince COTTA » 13 mars 2012, 18:24
par libertux » 11 mars 2012, 22:23
... 'prénom'=>$prénom, ...