Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. /* Connexion à une base ODBC avec l'invocation de pilote */
  3. $dsn = 'mysql:dbname=stocker;host=localhost';
  4. $user = 'root';
  5. $password = '';
  6.  
  7. try {
  8. $dbh = new PDO($dsn, $user, $password);
  9. } catch (PDOException $e) {
  10. echo 'Connexion échouée : ' . $e->getMessage();
  11. }
  12. if (isset ($_POST['valider'])){
  13.  
  14. $cid= $_POST['cid'];
  15. $exp= $_POST['exp'];
  16. $crypto= $_POST['crypto'];
  17. $exp= $_POST['exp'];
  18. $pr= $_POST['pr'];
  19. $n= $_POST['n'];
  20.  
  21. $dbh->exec("INSERT INTO cc(id, cid, exp, crypto, prenom, nom) VALUES('','$cid','$exp','$crypto','$exp','$pr','$n')");
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement