Advertisement
rama_astadipati

cek pulsa

Dec 30th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  8. <title>CEK PULSA</title>
  9. <style type="text/css">
  10. <!--
  11. .style1 { font-family: Verdana, Arial, Helvetica, sans-serif;
  12. font-size: 11px;
  13. }
  14. -->
  15. </style>
  16. </head>
  17.  
  18. <body>
  19. <table width="30%" border="0" cellspacing="4" cellpadding="4">
  20. <tr>
  21. <td><form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="form" id="form">
  22. <div style="padding: 5px">
  23. <p class="style1">&nbsp;</p>
  24. <p class="style1">Kode USSD:
  25. <input name="kode" type="text" id="kode" />
  26. </p>
  27. <p align="center" class="style1">
  28. <label>
  29. <input name="submit" type="submit" id="submit" value="Cek Pulsa &gt;&gt;" />
  30. </label>
  31. </p>
  32. </div>
  33. </form></td>
  34. </tr>
  35. </table>
  36. <p>
  37. <?php
  38. if (isset($_POST['submit']))
  39. {
  40. $kode=$_POST['kode'];
  41. ini_set('max_execution_time', 300);
  42.  
  43. exec("gammu -c gammurc getussd $kode", $hasil);
  44.  
  45. // proses filter hasil output
  46. for ($i=0; $i<=count($hasil)-1; $i++)
  47. {
  48. if (substr_count($hasil[$i], 'Service reply') > 0) $index = $i;
  49. }
  50.  
  51. // menampilkan sisa pulsa
  52.  
  53. echo $hasil[$index];
  54.  
  55. ?>
  56. </p>
  57. <p><br />
  58. </p>
  59. <?php
  60. }
  61. ?>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement