manaluni

not working

Oct 24th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. $response = $telnet->read();
  2.  
  3.             $line = $response;
  4.             $line = str_replace('<I>', '', $line);
  5.             preg_match($rules[1], $line, $match, PREG_OFFSET_CAPTURE);
  6.             if (isset($match[0][0])) {
  7.                 for ($i = 0; $i < count($rules); $i++) {
  8.                     preg_match($rules[$i], $line, $match, PREG_OFFSET_CAPTURE);
  9.                     $result[$i] = (isset($match[0])) ? trim($match[0][0]) : null;
  10.                     $line = preg_replace($rules[$i], '', $line, 1);
  11.                 }
  12.                 $query = "INSERT INTO `logs`(`datum`,`tijd`,`intern`,`netlijn`,`naam`,`telefoonnummer`,`ring`,`duratie`,`kosten`,`conditie_code`) VALUES(:dat,:tijd,:int,:net,:naam,:tel,:ring,:dur,:kost,:con)";
  13.                 $stmnt = $db->prepare($query);
  14.                 if(empty($result[9])){
  15.                     $result[9] = NULL;
  16.                 }
  17.                 $results = $stmnt->execute(Array(":dat" => $result[0], ":tijd" => $result[1], ":int" => $result[2], ":net" => $result[3], ":naam" => $result[4], ":tel" => $result[5], ":ring" => $result[6], ":dur" => $result[7], ":kost" => $result[8], ":con" =>$result[9]));
  18.  
  19.                 echo $response.'<br />';
  20.                 flush();
  21.                 ob_flush();
  22.                 usleep(1250);
  23.                 //send echo to screen.
  24.  
  25.             }
  26.             response = null; //reset the respons variable, so it HAS to be refilled again with the new value.
  27.              
  28.            
  29.  
  30.  
  31.     $telnet->Disconnect();
Add Comment
Please, Sign In to add comment