Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function save()
- {
- var hist = document.getElementById("hist").value;
- var mission = document.getElementById("mission").value;
- var params = "history=" + hist+ "&mission=" + mission;
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function()
- {
- if (this.readyState == 4 && this.status == 200 )
- {
- UserAccountInfo = this.responseText;
- alert(UserAccountInfo);
- }
- }
- xmlhttp.open("POST","savecompany.php",true);
- xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- xmlhttp.send(params);
- }
- <?php
- require "conn.php";
- $history= $_POST["history"];
- $mission = $_POST["mission"];
- $sql = " UPDATE company SET history ='$history' , mission='$mission' where id='1'";
- mysqli_query($conn,$sql);
- echo "done";
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement