From ali, 6 Years ago, written in Plain Text.
Embed
  1. <?php
  2.  
  3. mysql_connect("localhost","root","E5510331");
  4. mysql_select_db("invent");
  5. date_default_timezone_set("Asia/Karachi");
  6. if(isset($_REQUEST["gref"]))
  7. {
  8. // echo "<pre>";
  9. // print_r($_REQUEST);
  10. // die;
  11. $date=date('d-m-Y');
  12. $time=date('H:i:s');
  13. $gref=$_REQUEST["gref"];
  14. $gip=$_REQUEST["gip"];
  15. $gport=$_REQUEST["gport"];
  16. $staff=$_REQUEST["staff"];
  17. $mgw=$_REQUEST["mgw"];
  18. $mussd=$_REQUEST["mussd"];
  19. $prob=$_REQUEST["problem"];
  20. $action=$_REQUEST["action"];
  21. $comment=$_REQUEST["comment"];
  22.  
  23.  
  24. echo mysql_query("insert into minutes(date,time,g_ref,g_ip,g_port,staff,m_gw,m_ussd,problem,action,comment)values('$date','$time','$gref','$gip','$gport','$staff','$mgw','$mussd','$prob','$action','$comment')");
  25. die;
  26. }
  27. ?>
  28.  
  29. <!DOCTYPE html>
  30. <html>
  31. <head>
  32. <meta charset="utf-8" />
  33. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  34. <title>Page Title</title>
  35. <meta name="viewport" content="width=device-width, initial-scale=1">
  36. <link rel="stylesheet" type="text/css" media="screen" href="main.css" />
  37. <script src="main.js"></script>
  38. </head>
  39. <body>
  40. <form method="post" id="frm1">
  41. Gateway Ref:
  42. <select name="gref">
  43. <option>Select Any One</option>
  44. <option value="Ish-01-Qmr">Ish-01-Qmr</option>
  45. </select><br><br>
  46. Gateway IP:<Input type="radio"name="gip"value="192.168.101.101" required>192.168.101.101<Input type="radio"name="gip"value="192.168.101.102" required>192.168.101.102
  47. </select><br><br>
  48. Gateway Port:
  49. <select name="gport" required>
  50. <option value="">Select Any One</option>
  51. <option value="Port00">Port00</option>
  52. <option value="Port01">Port01</option>
  53. <option value="Port02">Port02</option>
  54. <option value="Port03">Port03</option>
  55. <option value="Port04">Port04</option>
  56. <option value="Port05">Port05</option>
  57. <option value="Port06">Port06</option>
  58. <option value="Port07">Port07</option>
  59. <option value="Port08">Port08</option>
  60. <option value="Port09">Port09</option>
  61. <option value="Port10">Port10</option>
  62. <option value="Port11">Port11</option>
  63. <option value="Port12">Port12</option>
  64. <option value="Port13">Port13</option>
  65. <option value="Port14">Port14</option>
  66. <option value="Port15">Port15</option>
  67. </select><br><br>
  68. Staff:<Input type="text" name="staff"><br><br>
  69. Minutes On Gateway:<Input type="text" name="mgw"><br><br>
  70. Minutes On USSD:<Input type="text" name="mussd"><br><br>
  71. Problem:
  72. <select name="problem">
  73. <option>Select Any One</option>
  74. <option value="Package minutes consumed.">Package minutes consumed.</option>
  75. <option value="Not showing USSD response.">Not showing USSD response.</option>
  76. <option value="Sim Blocked.">Sim Blocked.</option>
  77. <option value="Port Status showing Power Off.">Port Status showing Power Off.</option>
  78. <option value="Port Status showing No SIM Card.">Port Status showing No SIM Card.</option>
  79. </select><br><br>
  80. Action:
  81. <select name="action">
  82. <option>Select Any One</option>
  83. <option value="Minutes in overview are set as USSD.">Minutes in overview are set as USSD.</option>
  84. </select><br><br>
  85. Comments:<Input type="text" name="comment" required><br><br>
  86. <br><br>
  87. <Input type="submit" value="insert" name="submit">
  88. </form>
  89. </body>
  90. <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <!-- load jquery via CDN -->
  91. <script>
  92. $(document).ready(function(){
  93. $('form').submit(function(event) {
  94. event.preventDefault();
  95.  
  96. // get the form data
  97. // there are many ways to get this data using jQuery (you can use the class or id also)
  98. var formData = $(this).serializeArray()
  99.  
  100. // process the form
  101. $.ajax({
  102. type : 'POST', // define the type of HTTP verb we want to use (POST for our form)
  103. // url : '', // the url where we want to POST
  104. data : formData, // our data object
  105. dataType : 'json', // what type of data do we expect back from the server
  106. encode : true
  107. })
  108. // using the done promise callback
  109. .done(function(data) {
  110. document.getElementById('frm1').reset();
  111.  
  112. // log data to the console so we can see
  113. alert('done');
  114.  
  115. // here we will handle errors and validation messages
  116. });
  117.  
  118. // stop the form from submitting the normal way and refreshing the page
  119. });
  120.  
  121.  
  122. })
  123. </script>
  124. </html>

Replies to do-not-refresh rss

Title Name Language When
Re: do-not-refresh ali text 6 Years ago.