dnaextrim / php_zklib

Attendance Machine Library for PHP with a connection to the network using the UDP protocol and port 4370
http://dnaextrim.github.io/php_zklib/
GNU General Public License v2.0
160 stars 135 forks source link

zkteco new device #58

Open abdkaviani opened 5 years ago

abdkaviani commented 5 years ago

Hi everyone

I recently bought a PFace202 Device. My old device - MultiBio700 - it was working with "php_zklib" But i had a problem with my new device

My problem is solved when I edited current code to this:

Best Regards

$zk     = new ZKLib("192.168.10.201", 4370);
$ret    = $zk->connect();
sleep(1);
//if ( $ret ):  //REMOVE IT!!!
$zk->disableDevice();
.
.
.
//endif //REMOVE IT!!!
abdkaviani commented 5 years ago

AND in zkattendance.php replce

$id = intval( str_replace("\0", '', hex2bin( substr($u[1], 6, 8) ) ) ); with $id = intval( preg_replace("/[^A-Za-z0-9 ]/", '', hex2bin( substr($u[1], 6, 8) ) ) );