SHOW:
|
|
- or go back to the newest paste.
| 1 | #!/usr/bin/php -q | |
| 2 | <?php | |
| 3 | require ('phpagi.php');
| |
| 4 | ||
| 5 | $agi = new AGI(); | |
| 6 | ||
| 7 | ob_impliciy_flush(true); | |
| 8 | set_time_limit(30); | |
| 9 | error_reporting(1); | |
| 10 | ||
| 11 | $agi->answer(); | |
| 12 | ||
| 13 | ||
| 14 | $con = mysql_connect("myip", "user", "password") or die (mysql_error());
| |
| 15 | ||
| 16 | mysql_select_db("dbase_pins",$con) or die (mysql_error());
| |
| 17 | $agi->Verbose(START); | |
| 18 | ||
| 19 | $agi->read(dialed_pin,,6,,2,3); | |
| 20 | $_result=$agi->get_variable("dialed_pin");
| |
| 21 | - | $dialed_pin=/*$_result['data'];*/("1234");
|
| 21 | + | $dialed_pin=$_result['data']; |
| 22 | ||
| 23 | ||
| 24 | ||
| 25 | $sql="INSERT INTO pines (pin) values ($dialed_pin);"; | |
| 26 | $res=mysql_query($sql,$con) or die (mysql_error()); | |
| 27 | //$rl=mysql_fetch_array($res); | |
| 28 | ||
| 29 | mysql_close($con); | |
| 30 | $agi->Verbose(END); | |
| 31 | $agi->hangup(); | |
| 32 | ?> |