Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- huita.php
- <?php
- $huita = $_POST["huita"];
- $db= new PDO("mysql:host=localhost;dbname=huitadb", "pidorname", "pidorpass");
- $st = $db->prepare("INSERT INTO huita_table ( huita_result ) values ( ? )");
- $st->bindParam(1, $huita);
- $st->execute();
- huita.js
- function saveResult(huitaResult)
- {
- var req = XMLHttpRequest();
- req.open('POST', '/hui/calculator/huita.php', true);
- req.send("huita=" ++ huitaResult);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement