Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <script>
  2. function insertrecord() {
  3. var xhttp = new XMLHttpRequest();
  4. xhttp.onreadystatechange = function() {
  5. if (this.readyState == 4 && this.status == 200) {
  6. //document.getElementById("demo").innerHTML = this.responseText;
  7. alert('Record Saved!');
  8.  
  9. }
  10. };
  11. var userid = document.getElementById("txtuid").value;
  12. var username = document.getElementById("txtusername").value;
  13. var password = document.getElementById("txtpassword").value;
  14.  
  15. //var page = "insertdata.php?uid=jacky&name=Jacky Boy&pass=lol";
  16. var page = "insertdata.php?uid="+ userid +"&name=" + username +"&pass=" + password;
  17. xhttp.open("GET", page, true);
  18. xhttp.send();
  19. }
  20.  
  21. </script>
  22. <!DOCTYPE html>
  23. <html>
  24. <body>
  25.  
  26. <input placeholder="Enter User Id" type="text" id="txtuid" value="" /><br>
  27. <input placeholder="Enter User Name" type="text" id="txtusername" value="" /><br>
  28. <input placeholder="Enter User Password" type="text" id="txtpassword" value="" /><br>
  29.  
  30. <input type="button" value="Insert Record" onclick="insertrecord()" />
  31.  
  32.  
  33. </body>
  34.  
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement