Advertisement
Guest User

Untitled

a guest
Apr 12th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. function ajax_runs3(value){
  2. var ajaxRequest; // The variable that makes Ajax possible!
  3. try{
  4. ajaxRequest = new XMLHttpRequest();
  5. } catch (e){
  6. // Internet Explorer Browsers
  7. try{
  8. ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  9. } catch (e) {
  10. try{
  11. ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
  12. } catch (e){
  13. // Something went wrong
  14. alert("Your browser broke!");
  15. return false;
  16. }
  17. }
  18. }
  19. ajaxRequest.onreadystatechange = function(){
  20. if(ajaxRequest.readyState == 4){
  21. document.myForm.time.value = ajaxRequest.responseText;
  22. }
  23. }
  24.  
  25. var runs3= value;
  26. ajaxRequest.open("POST","runs3.php"+ runs3, true);
  27. ajaxRequest.send(null);
  28. }
  29.  
  30. <?php
  31. $servername = "localhost";
  32. $username = "labi8575_admin";
  33. $password = "ParAnoikOs13";
  34. $dbname = "labi8575_inventory";
  35. $conn = mysql_connect($servername, $username, $password);
  36. if(! $conn )
  37. {
  38. die('Could not connect: ' . mysql_error());
  39. }
  40. mysql_select_db('labi8575_inventory');
  41. $runs3 = $_POST["runs3"];
  42. $sql = mysql_query("UPDATE demo SET runs3 = '$runs3'");
  43. $retval = mysqli_query( $sql, $conn );
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement