Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <form id="login_form">
  2. Login<br/>
  3. user: <input id="login_user" name="login_user" type="text" /><br/>
  4. pass: <input id="login_pass" name="login_pass" type="password" /><br/>
  5. <input type="button" value="Submit" onclick="doStuff("login")" />
  6. </form>
  7.  
  8. function doStuff(doWhat){
  9.  
  10. var sendString = new FormData(document.getElementById("login_form"));
  11.  
  12. if(window.XMLHttpRequest){
  13. xmlhttp = new XMLHttpRequest();
  14. }else{
  15. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  16. }
  17. xmlhttp.open("POST", "?action="+doWhat, true);
  18. xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  19. xmlhttp.onreadystatechange = function(){
  20. if(this.readyState == 4 && this.status == 200){
  21. //do stuff
  22. }
  23. };
  24. xmlhttp.send(sendString);
  25. }
  26.  
  27. D:wamp64wwwtestindex.php:18:
  28. array (size=1)
  29. '------WebKitFormBoundaryubX9lqZJrSEuJwB9
  30. Content-Disposition:_form-data;_name' => string '"login_user"
  31.  
  32. admin
  33. ------WebKitFormBoundaryubX9lqZJrSEuJwB9
  34. Content-Disposition: form-data; name="login_pass"
  35.  
  36. swordfish
  37. ------WebKitFormBoundaryubX9lqZJrSEuJwB9--
  38. ' (length=173)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement