Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. function save()
  2. {
  3.  
  4. var hist = document.getElementById("hist").value;
  5. var mission = document.getElementById("mission").value;
  6.  
  7. var params = "history=" + hist+ "&mission=" + mission;
  8. var xmlhttp = new XMLHttpRequest();
  9. xmlhttp.onreadystatechange = function()
  10. {
  11. if (this.readyState == 4 && this.status == 200 )
  12. {
  13.  
  14. UserAccountInfo = this.responseText;
  15. alert(UserAccountInfo);
  16. }
  17. }
  18. xmlhttp.open("POST","savecompany.php",true);
  19. xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  20. xmlhttp.send(params);
  21. }
  22.  
  23. <?php
  24.  
  25. require "conn.php";
  26.  
  27.  
  28. $history= $_POST["history"];
  29. $mission = $_POST["mission"];
  30.  
  31. $sql = " UPDATE company SET history ='$history' , mission='$mission' where id='1'";
  32. mysqli_query($conn,$sql);
  33.  
  34.  
  35. echo "done";
  36. mysqli_close($conn);
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement