Advertisement
Guest User

Untitled

a guest
Feb 7th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. huita.php
  2.  
  3. <?php
  4.  
  5. $huita = $_POST["huita"];
  6. $db= new PDO("mysql:host=localhost;dbname=huitadb", "pidorname", "pidorpass");
  7.  
  8. $st = $db->prepare("INSERT INTO huita_table ( huita_result ) values ( ? )");
  9.  
  10. $st->bindParam(1, $huita);
  11. $st->execute();
  12.  
  13.  
  14. huita.js
  15.  
  16. function saveResult(huitaResult)
  17. {
  18. var req = XMLHttpRequest();
  19. req.open('POST', '/hui/calculator/huita.php', true);
  20. req.send("huita=" ++ huitaResult);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement