Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>CEK PULSA</title>
- <style type="text/css">
- <!--
- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
- }
- -->
- </style>
- </head>
- <body>
- <table width="30%" border="0" cellspacing="4" cellpadding="4">
- <tr>
- <td><form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="form" id="form">
- <div style="padding: 5px">
- <p class="style1"> </p>
- <p class="style1">Kode USSD:
- <input name="kode" type="text" id="kode" />
- </p>
- <p align="center" class="style1">
- <label>
- <input name="submit" type="submit" id="submit" value="Cek Pulsa >>" />
- </label>
- </p>
- </div>
- </form></td>
- </tr>
- </table>
- <p>
- <?php
- if (isset($_POST['submit']))
- {
- $kode=$_POST['kode'];
- ini_set('max_execution_time', 300);
- exec("gammu -c gammurc getussd $kode", $hasil);
- // proses filter hasil output
- for ($i=0; $i<=count($hasil)-1; $i++)
- {
- if (substr_count($hasil[$i], 'Service reply') > 0) $index = $i;
- }
- // menampilkan sisa pulsa
- echo $hasil[$index];
- ?>
- </p>
- <p><br />
- </p>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement