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

Replies to Re: do-not-refresh rss

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