Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Getformulaire.php 1.1KB

il y a 9 mois
123456789101112131415161718192021222324252627282930
  1. <?php
  2. session_start();
  3. include 'include/header.php';
  4. $objetPdo = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php');
  5. $pdoStat = $objetPdo->prepare('INSERT INTO products VALUES (NULL, :nom, :qualite, :prix, :prixlivr, :pays, :description, :iduser)');
  6. $pdoStat->bindValue(':nom',$_POST['name'], PDO::PARAM_STR);
  7. $pdoStat->bindValue(':qualite',$_POST['quality'], PDO::PARAM_STR);
  8. $pdoStat->bindValue(':prix',$_POST['price'], PDO::PARAM_STR);
  9. $pdoStat->bindValue(':prixlivr',$_POST['deliveryprice'], PDO::PARAM_STR);
  10. $pdoStat->bindValue(':pays',$_POST['country'], PDO::PARAM_STR);
  11. $pdoStat->bindValue(':description',$_POST['content'], PDO::PARAM_STR);
  12. $pdoStat->bindValue(':iduser',$_SESSION['id'] , PDO::PARAM_STR);
  13. $insertIsOk = $pdoStat->execute();
  14. if($insertIsOk){
  15. $message = 'Votre annonce a été prises en compte<br \><br \><a href="homepage.php">Page d\'accueil</a>';
  16. }
  17. else{
  18. $message = 'Votre demande n\'a pu etre effectué essayés plus tard <br \><br \><a href="homepage.php">Page d\'accueil</a>';
  19. }
  20. ?>
  21. <div class="message">
  22. <?php echo $message ?>
  23. </div>