| @@ -0,0 +1,30 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| include 'include/header.php'; | |||||
| $objetPdo = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $pdoStat = $objetPdo->prepare('INSERT INTO products VALUES (NULL, :nom, :qualite, :prix, :prixlivr, :pays, :description, :iduser)'); | |||||
| $pdoStat->bindValue(':nom',$_POST['name'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':qualite',$_POST['quality'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prix',$_POST['price'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prixlivr',$_POST['deliveryprice'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':pays',$_POST['country'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':description',$_POST['content'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':iduser',$_SESSION['id'] , PDO::PARAM_STR); | |||||
| $insertIsOk = $pdoStat->execute(); | |||||
| if($insertIsOk){ | |||||
| $message = 'Votre annonce a été prises en compte<br \><br \><a href="homepage.php">Page d\'accueil</a>'; | |||||
| } | |||||
| else{ | |||||
| $message = 'Votre demande n\'a pu etre effectué essayés plus tard <br \><br \><a href="homepage.php">Page d\'accueil</a>'; | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -0,0 +1,24 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| $objetpdoinscription = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $Pdostatinscripton = $objetpdoinscription->prepare('INSERT INTO users VALUES (NULL, :mail, :motdepasse, :nom, :prenom)'); | |||||
| $Pdostatinscripton->bindValue(':mail',$_POST['login'], PDO::PARAM_STR); | |||||
| $Pdostatinscripton->bindValue(':motdepasse',$_POST['password'], PDO::PARAM_STR); | |||||
| $Pdostatinscripton->bindValue(':nom',$_POST['name'], PDO::PARAM_STR); | |||||
| $Pdostatinscripton->bindValue(':prenom',$_POST['surname'], PDO::PARAM_STR); | |||||
| $insertIsOk = $Pdostatinscripton->execute(); | |||||
| if($insertIsOk){ | |||||
| $message = 'Votre Compte a été crée<br /><br /><a href="homepage.php">Page d\'accueil</a><br /><br /><a href="connexion.php">Page de connexion</a>'; | |||||
| } | |||||
| else{ | |||||
| $message = "Probleme de création de compte revenez plus tard"; | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -0,0 +1,32 @@ | |||||
| <h2>Liste des Utilisateurs</h2> | |||||
| <table> | |||||
| <tr> | |||||
| <th>ID</th> | |||||
| <th>LOGIN</th> | |||||
| <th>NOM</th> | |||||
| <th>PRENOM</th> | |||||
| <th>ACTIONS</th> | |||||
| </tr> | |||||
| <?php | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $reqBlog='SELECT * FROM users'; | |||||
| $prep=$db->prepare($reqBlog); | |||||
| $prep->execute(); | |||||
| $mon_blog=$prep->fetchAll(PDO::FETCH_BOTH); | |||||
| foreach ($mon_blog as $user) { | |||||
| ?> | |||||
| <tr> | |||||
| <td><?=$user['idusers'];?></td> | |||||
| <td><?=$user['login'];?></td> | |||||
| <td><?=$user['name'];?></td> | |||||
| <td><?=$user['prenom'];?></td> | |||||
| <td> | |||||
| <a href='delete.php?id=<?=$user['idusers'];?>' title='Supprimer'>X</a> | |||||
| <a href='update.php?id=<?=$user['idusers'];?>' title='Modifier'>M</a> | |||||
| </td> | |||||
| </tr> | |||||
| <?php | |||||
| } | |||||
| ?> | |||||
| </table> | |||||
| @@ -0,0 +1,28 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||
| <body class="body" style="margin: 0px;"> | |||||
| <div class="conteneurprincipal"> | |||||
| <div class="conteneurinsconn"> | |||||
| <div> | |||||
| <a class="logo"><img height="150px" src=./img/Logoburned.png></a> | |||||
| <br><br><br> | |||||
| <span class="nomconteneur">CONNEXION</span> | |||||
| <br><br> | |||||
| <span class="nomconteneur">Authentifiez-vous</span> | |||||
| </div> | |||||
| <div id=connexion> | |||||
| <form method="post" action="traitementconnexion.php"> | |||||
| <p> | |||||
| <label class="titrebox">Login : </label><input name="login" type="text" id="login" /><br /> | |||||
| <label class="titrebox">Mot de Passe :</label><input type="password" name="password" id="password" /> | |||||
| </p> | |||||
| <p><input type="submit" value="Connexion" /></p></form> | |||||
| <a href="inscription.php">Pas encore inscrit ?</a> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| @@ -0,0 +1,10 @@ | |||||
| <?php | |||||
| $id = filter_input(INPUT_GET,'id', FILTER_SANITIZE_NUMBER_INT); | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $reqNewName='Delete FROM users where idusers=?'; | |||||
| $prep=$db->prepare($reqNewName); | |||||
| $prep->bindParam(1, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| ?> | |||||
| <a class="message" href='administrateur.php' title='Supprimer'>Utilisateur Effacé!</a> | |||||
| @@ -0,0 +1,40 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| $objetpdohomepage = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $reponse = $objetpdohomepage->query('SELECT * FROM products'); | |||||
| ?> | |||||
| <header class="header"><a class="logo"><img height="150px" src=./img/Logoburned.png></a><a class="header-middle-area"></a><a class="bouton_header" href="postformulaire.php">Vendre </a><a class="bouton_header" href="inscription.php">Inscription</a><a class="bouton_header" href="connexion.php">Connexion</a></header> | |||||
| <div class="corp"> | |||||
| <aside class="aside"> | |||||
| <label id="qualitelabel"> Annonces: </label> | |||||
| </aside> | |||||
| <a class="main"> | |||||
| <?php while ($donnees = $reponse->fetch()) | |||||
| { | |||||
| ?> | |||||
| <strong><?php echo $donnees['name']; ?></strong><br> | |||||
| <strong> Qualités:</strong> <?php echo $donnees['quality']; ?> <br> | |||||
| <strong>Prix:</strong> <?php echo $donnees['price']; ?> € <br> | |||||
| <strong>Prix de livraison: </strong><?php echo $donnees['deliveryprice']; ?> € <br> | |||||
| <strong>Description du produit: </strong> <?php echo $donnees['content']; ?> <br> | |||||
| <strong>Expéditeur </strong> <?php echo $donnees['idusers']; ?> <br> | |||||
| <br> | |||||
| <?php | |||||
| } | |||||
| $reponse->closeCursor(); // Termine le traitement de la requête | |||||
| ?> | |||||
| </a> | |||||
| </div> | |||||
| </body> | |||||
| </html> | |||||
| @@ -0,0 +1,2 @@ | |||||
| </body> | |||||
| </html> | |||||
| @@ -0,0 +1,10 @@ | |||||
| <!DOCTYPE html> | |||||
| <html> | |||||
| <head> | |||||
| <link href="stylesheet.css" rel="stylesheet" type="text/css"> | |||||
| <link href="include/bootstrap.css" rel="stylesheet"> | |||||
| <meta charset="UTF-8"> | |||||
| <title>projetweb</title> | |||||
| <script src="https://kit.fontawesome.com/f823ffd272.js" crossorigin="anonymous"></script> | |||||
| </head> | |||||
| <body> | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <a href='connexion.php'>connexion</a><br> | |||||
| <a href='inscription.php'>inscription</a><br> | |||||
| <a href='profil.php'>profil</a><br> | |||||
| <a href='homepage.php'>Home page</a><br> | |||||
| <a href='postformulaire.php'>poster</a><br> | |||||
| <?php | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||
| @@ -0,0 +1,38 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <body class="body" style="margin: 0px;"> | |||||
| <div class="conteneurprincipal"> | |||||
| <div> | |||||
| <div class="conteneurinsconn"> | |||||
| <div> | |||||
| <a class="logo"><img height="150px" src=./img/Logoburned.png></a> | |||||
| <br> | |||||
| <span class="nomconteneur">INSCRIPTION</span> | |||||
| <br> | |||||
| <span class="nomconteneur">Renseignez les informations</span> | |||||
| </div> | |||||
| <div id="containerbox"> | |||||
| <form method="post" action="Getinscription.php"> | |||||
| <label class="titrebox">Renseigner votre email:</label> | |||||
| <input type="text" id="mail" name="login" /><br /> | |||||
| <label class="titrebox">Choisissez un mot de passe:</label> | |||||
| <input type="password" id="motdepasse" name="password" /><br /> | |||||
| <label class="titrebox">Entrez votre nom:</label> | |||||
| <input type="text" id="nom" name="name" /><br /> | |||||
| <label class="titrebox">Entrez votre prénom:</label> | |||||
| <input type="text" id="prenom" name="surname" /><br /> | |||||
| <br> | |||||
| <p id="buttons"> | |||||
| <input type="submit" value="Enregister" /> | |||||
| </p> | |||||
| </form> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| @@ -0,0 +1 @@ | |||||
| run.as=LOCAL | |||||
| @@ -0,0 +1,11 @@ | |||||
| browser.id=default | |||||
| copy.src.files=false | |||||
| copy.src.on.open=false | |||||
| copy.src.target= | |||||
| include.path.private= | |||||
| index.file=homepage.php | |||||
| remote.connection=debian_sev-8154ff | |||||
| remote.directory=/PhpProject1 | |||||
| remote.upload=ON_RUN | |||||
| run.as=REMOTE | |||||
| url=http://localhost:8080/monsitephp/PhpProject1 | |||||
| @@ -0,0 +1,14 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project-private xmlns="http://www.netbeans.org/ns/project-private/1"> | |||||
| <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> | |||||
| <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> | |||||
| <group> | |||||
| <file>file:/C:/Users/bapti/Documents/NetBeansProjects/PHP-B1G2/Getformulaire.php</file> | |||||
| <file>file:/C:/Users/bapti/Documents/NetBeansProjects/PHP-B1G2/connexion.php</file> | |||||
| <file>file:/C:/Users/bapti/Documents/NetBeansProjects/PHP-B1G2/administrateur.php</file> | |||||
| <file>file:/C:/Users/bapti/Documents/NetBeansProjects/PHP-B1G2/inscription.php</file> | |||||
| <file>file:/C:/Users/bapti/Documents/NetBeansProjects/PHP-B1G2/homepage.php</file> | |||||
| <file>file:/C:/Users/bapti/Documents/NetBeansProjects/PHP-B1G2/postformulaire.php</file> | |||||
| </group> | |||||
| </open-files> | |||||
| </project-private> | |||||
| @@ -0,0 +1,11 @@ | |||||
| browser.reload.on.save=true | |||||
| code.analysis.excludes= | |||||
| ignore.path= | |||||
| include.path=\ | |||||
| ${php.global.include.path} | |||||
| php.version=PHP_74 | |||||
| source.encoding=UTF-8 | |||||
| src.dir=. | |||||
| tags.asp=false | |||||
| tags.short=false | |||||
| web.root=. | |||||
| @@ -0,0 +1,9 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project xmlns="http://www.netbeans.org/ns/project/1"> | |||||
| <type>org.netbeans.modules.php.project</type> | |||||
| <configuration> | |||||
| <data xmlns="http://www.netbeans.org/ns/php-project/1"> | |||||
| <name>PhpProject1</name> | |||||
| </data> | |||||
| </configuration> | |||||
| </project> | |||||
| @@ -0,0 +1,33 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <form method="post" action="Getformulaire.php"> | |||||
| <p class="titre">Fiche technique</p> | |||||
| <fieldset id="coordonnees"> | |||||
| <label>Nom du produit : </label> | |||||
| <input type="text" id="nom" name="name" /><br /> | |||||
| <label>Qualité : </label> | |||||
| <input type="text" id="qualite" name="quality" /><br /> | |||||
| <label>Prix produit </label> | |||||
| <input type="text" id="prix" name="price" /><br /> | |||||
| <label>Prix livraison </label> | |||||
| <input type="text" id="prixlivr" name="deliveryprice" /><br /> | |||||
| <label>Pays : </label> | |||||
| <input type="text" id="pays" name="country" /><br /> | |||||
| </fieldset> | |||||
| <p class="titre">Description</p> | |||||
| <fieldset id="Description"> | |||||
| <textarea id="description" name="content" rows="5" cols="40"></textarea> | |||||
| </fieldset> | |||||
| <p id="buttons"> | |||||
| <input type="submit" value="Enregister" /> | |||||
| </p> | |||||
| </form> | |||||
| <br> | |||||
| <a href="homepage.php"><button >Page d'accueil</button></a> | |||||
| @@ -0,0 +1,113 @@ | |||||
| <style> | |||||
| #containergeneral{ | |||||
| height: 1500px; | |||||
| width: 100%; | |||||
| } | |||||
| #banniere{ | |||||
| background-image: url(./img/ban.jpg); | |||||
| background-attachment: fixed; | |||||
| height: 200px; | |||||
| width: 1900px; | |||||
| } | |||||
| #diventete{ | |||||
| background-color: rgb(211, 208, 208); | |||||
| height: 300px; | |||||
| width: 1900px; | |||||
| display: flex; | |||||
| justify-content: space-between; | |||||
| } | |||||
| #nom{ | |||||
| padding-top: 90px; | |||||
| padding-left: 370px; | |||||
| justify-self: right; | |||||
| } | |||||
| #img{ | |||||
| height: 300px; | |||||
| width: 300px; | |||||
| } | |||||
| #divpage{ | |||||
| height: 700px; | |||||
| width: 1900px; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| flex-direction: row; | |||||
| } | |||||
| #divgauche{ | |||||
| height: 1100px; | |||||
| width: 950px | |||||
| } | |||||
| #divdroite{ | |||||
| background-color: whitesmoke; | |||||
| height: 1100px; | |||||
| width: 950px; | |||||
| border-left: 2px solid black; | |||||
| } | |||||
| #informations{ | |||||
| } | |||||
| #site{ | |||||
| padding-left: 30px; | |||||
| font-size: xx-large; | |||||
| font-weight: bold; | |||||
| font-family: sans-serif; | |||||
| background-image: url(./img/banniere); | |||||
| background-attachment: fixed; | |||||
| } | |||||
| #button{ | |||||
| height: 80px; | |||||
| width: 100px; | |||||
| } | |||||
| .infor{ | |||||
| font-size: xx-large; | |||||
| font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; | |||||
| } | |||||
| .titreinf{ | |||||
| font-size: x-large; | |||||
| font-weight: bold; | |||||
| font-family:sans-serif; | |||||
| margin-top: 150px; | |||||
| margin-left: 150px; | |||||
| } | |||||
| </style> | |||||
| <body style="margin: 0px;"> | |||||
| <div id="banniere"> | |||||
| </div> | |||||
| <div id="diventete"> | |||||
| <div id="nom"> | |||||
| <span class="infor">Julien Robert</span> | |||||
| <br> | |||||
| <span class="infor">23/08/1996</span> | |||||
| <br> | |||||
| <span class="infor"> | |||||
| <i class="fab fa-steam"></i> | |||||
| <i class="fab fa-playstation"></i> | |||||
| <i class="fab fa-xbox"></i> | |||||
| <i class="fas fa-gamepad"></i> | |||||
| <i class="fas fa-chess"></i> | |||||
| </span> | |||||
| </div> | |||||
| <div id="photo"> | |||||
| <img src="./img/profil.jpeg" id="img"></img> | |||||
| </div> | |||||
| </div> | |||||
| <div id="divpage"> | |||||
| <div id="divgauche"> | |||||
| <div id="informations"> | |||||
| <p class="titreinf">Pseudo</p> | |||||
| <br> | |||||
| <p class="titreinf">Pays</p> | |||||
| <br> | |||||
| <p class="titreinf">Description</p> | |||||
| <br> | |||||
| </div> | |||||
| </div> | |||||
| <div id="divdroite"> | |||||
| <div id=ventes> | |||||
| <p class="titreinf">VENTES</p> | |||||
| </div> | |||||
| <a href='postformulaire.php' title='sdze'>X</a> | |||||
| <div id=achats></div> | |||||
| <p class="titreinf">ACHATS</p> | |||||
| </div> | |||||
| </div> | |||||
| @@ -0,0 +1,124 @@ | |||||
| /*formulaire*/ | |||||
| fieldset{ | |||||
| background-color: rgb(163, 208, 219); | |||||
| } | |||||
| legend{ | |||||
| font-weight: bold; | |||||
| } | |||||
| .champ{ | |||||
| margin-bottom: 10px; | |||||
| } | |||||
| textarea{ | |||||
| width: 80%; | |||||
| height: 100px; | |||||
| background-color: rgba(154, 255, 255, 0.623); | |||||
| } | |||||
| input{ | |||||
| width: 150px; | |||||
| } | |||||
| input[type="radio"], input[type="checkbox"]{ | |||||
| width: auto; | |||||
| } | |||||
| input[type="submit"]{ | |||||
| width: 100px; | |||||
| } | |||||
| /*Homepage*/ | |||||
| .header { | |||||
| display: flex; | |||||
| background: #a6e0da; | |||||
| justify-content: space-between; | |||||
| flex-wrap: nowrap; | |||||
| align-items: center; | |||||
| flex-flow: row wrap; | |||||
| list-style: none; | |||||
| margin: 0; | |||||
| } | |||||
| .logo{ | |||||
| flex-grow:1; | |||||
| } | |||||
| .bouton_header{ | |||||
| flex-grow:1; | |||||
| font-size:200%; | |||||
| color:white; | |||||
| } | |||||
| .header-middle-area{ | |||||
| flex-grow: 4; | |||||
| } | |||||
| .body{ | |||||
| background-color: rgb(49, 49, 49); | |||||
| } | |||||
| .aside{ | |||||
| flex-direction: column; | |||||
| background-color: green; | |||||
| } | |||||
| .main { | |||||
| text-align: left; | |||||
| background: deepskyblue; | |||||
| } | |||||
| .corp{ | |||||
| display: flex; | |||||
| flex-flow: row wrap; | |||||
| text-align: center; | |||||
| } | |||||
| .corp > * { | |||||
| padding: 10px; | |||||
| flex: 1 100%; | |||||
| } | |||||
| .message{ | |||||
| margin-top: 20%; | |||||
| text-align: center; | |||||
| } | |||||
| @media all and (min-width: 600px) { | |||||
| .aside { flex: 1 0 0; } | |||||
| } | |||||
| /*Inscription/connection*/ | |||||
| .titrebox{ | |||||
| font-family: 'Times New Roman', Times, serif; | |||||
| color: rgb(117, 117, 117); | |||||
| display: block; | |||||
| width: 98%; | |||||
| height: 10px; | |||||
| padding-left: 3px; | |||||
| font-weight: bold; | |||||
| padding-bottom: 20px; | |||||
| } | |||||
| .titrebox{ | |||||
| font-family: 'Times New Roman', Times, serif; | |||||
| color: rgb(117, 117, 117); | |||||
| display: block; | |||||
| width: 98%; | |||||
| height: 10px; | |||||
| padding-left: 3px; | |||||
| font-weight: bold; | |||||
| padding-bottom: 20px; | |||||
| } | |||||
| .conteneurprincipal{ | |||||
| padding-top: 10%; | |||||
| padding-bottom: 10%; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| background-attachment:fixed; | |||||
| } | |||||
| .conteneurinsconn{ | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| text-align: center; | |||||
| justify-content: space-around; | |||||
| height: 580px; | |||||
| width: 400px; | |||||
| background-color: rgb(219, 213, 213); | |||||
| border:2px solid rgb(165, 184, 212); | |||||
| border-radius:10px; | |||||
| } | |||||
| .nomconteneur{ | |||||
| height: 100px; | |||||
| font-size: x-large; | |||||
| text-align: center; | |||||
| color: black; | |||||
| font-family:sans-serif; | |||||
| font-weight: bold; | |||||
| } | |||||
| @@ -0,0 +1,44 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| include 'include/header.php'; | |||||
| $login = filter_input(INPUT_POST,'login'); | |||||
| $password = filter_input(INPUT_POST,'password'); | |||||
| $message=''; | |||||
| if (empty($login) || empty($password) ) //Oublie d'un champ | |||||
| { | |||||
| $message = '<p>Vous devez remplir tous les champs</p> | |||||
| <p>Cliquez <a href="./connexion.php">ici</a> pour revenir</p>'; | |||||
| } | |||||
| else //On check le mot de passe | |||||
| { | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $query=$db->prepare('SELECT * FROM users WHERE login = :login'); | |||||
| $query->bindValue(':login',$login, PDO::PARAM_STR); | |||||
| $query->execute(); | |||||
| $data=$query->fetch(PDO::FETCH_BOTH); | |||||
| if ($data['password'] == $password) // Acces OK ! | |||||
| { | |||||
| $_SESSION['login'] = $data['login']; | |||||
| $_SESSION['id'] = $data['idusers']; | |||||
| $message = '<p>Bienvenue '.$data['prenom'].' '.$data['name'].', | |||||
| vous êtes maintenant connecté!</p> | |||||
| <br /><br />Cliquez <a href="profil.php">ici</a> | |||||
| pour continuer</p>'; | |||||
| } | |||||
| else // Acces pas OK ! | |||||
| { | |||||
| $message = '<p>Les identifiants | |||||
| renseignés ne sont pas corrects.</p><p>Cliquez <a href="./connexion.php">ici</a> | |||||
| pour revenir à la page précédente'; | |||||
| } | |||||
| $query->CloseCursor(); | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -0,0 +1,44 @@ | |||||
| <form method="post"> | |||||
| login: <input type="text" name="login"><br> | |||||
| password: <input type="text" name="password"><br> | |||||
| nom: <input type="text" name="name"><br> | |||||
| prenom: <input type="text" name="prenom"><br> | |||||
| <input type="submit"> | |||||
| </form> | |||||
| <?php | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $id = filter_input(INPUT_GET,'id', FILTER_SANITIZE_NUMBER_INT); | |||||
| if(isset($_POST["login"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET login= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["login"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if(isset($_POST["password"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET password= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["password"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if(isset($_POST["name"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET name= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["name"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if(isset($_POST["prenom"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET prenom= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["prenom"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||