【问题标题】:Connect finger print via php通过php连接指纹
【发布时间】:2015-12-16 07:11:35
【问题描述】:

我尝试将指纹连接到php,但出现此错误消息:

Warning: fsockopen(): unable to connect to 192.168.1.102:80 (连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应。)

这是我的代码

<?
$IP=$_GET["ip"];
$Key=$_GET["key"];
if($IP=="") $IP="192.168.1.201";
if($Key=="") $Key="0";
?>

<form action="tarik-data.php">
IP Address: <input type="Text" name="ip" value="<?=$IP?>" size=15><BR>
Comm Key: <input type="Text" name="key" size="5" value="<?=$Key?>"><BR><BR>

<input type="Submit" value="Download">
</form>
<BR>

<?
if($_GET["ip"]!=""){?>
    <table cellspacing="2" cellpadding="2" border="1">
    <tr align="center">
        <td><B>UserID</B></td>
        <td width="200"><B>Tanggal & Jam</B></td>
        <td><B>Verifikasi</B></td>
        <td><B>Status</B></td>
    </tr>
    <?
    $Connect = fsockopen($IP, "80", $errno, $errstr, 1);
    if($Connect){
        $soap_request="<GetAttLog><ArgComKey xsi:type=\"xsd:integer\">".$Key."</ArgComKey><Arg><PIN xsi:type=\"xsd:integer\">All</PIN></Arg></GetAttLog>";
        $newLine="\r\n";
        fputs($Connect, "POST /iWsService HTTP/1.0".$newLine);
        fputs($Connect, "Content-Type: text/xml".$newLine);
        fputs($Connect, "Content-Length: ".strlen($soap_request).$newLine.$newLine);
        fputs($Connect, $soap_request.$newLine);
        $buffer="";
        while($Response=fgets($Connect, 1024)){
            $buffer=$buffer.$Response;
        }
    }else echo "Koneksi Gagal";

    include("parse.php");
    $buffer=Parse_Data($buffer,"<GetAttLogResponse>","</GetAttLogResponse>");
    $buffer=explode("\r\n",$buffer);
    for($a=0;$a<count($buffer);$a++){
        $data=Parse_Data($buffer[$a],"<Row>","</Row>");
        $PIN=Parse_Data($data,"<PIN>","</PIN>");
        $DateTime=Parse_Data($data,"<DateTime>","</DateTime>");
        $Verified=Parse_Data($data,"<Verified>","</Verified>");
        $Status=Parse_Data($data,"<Status>","</Status>");
    ?>
    <tr align="center">
            <td><?echo $PIN?></td>
            <td><?=$DateTime?></td>
            <td><?=$Verified?></td>
            <td><?=$Status?></td>
        </tr>
    <?}?>
    </table>
<?}?>

请帮帮我,为什么我无法将 php 连接到指纹?

更新

我可以 ping 192.168.1.102,但我不能从 php 调用它。

【问题讨论】:

  • 192.168.1.102上是否有服务监听80端口?您收到的错误表明您的代码工作正常......但是您正在敲门并且没有人在家。
  • @Ragdata 检查我的更新。我可以 ping 192.168.1.102,但我不能从 php 调用它。
  • 很可能您在该机器上的端口 80 上没有任何监听 - 或者端口 80 已被防火墙保护,无法从本地网络访问。
  • @Ragdata 但为什么呢?我的FP有问题吗?我尝试使用桌面软件,很好。
  • 我们在这里谈论的是 X100-C 吗?

标签: php fingerprint fsockopen


【解决方案1】:

您的指纹可能不支持网络服务

通过浏览器检查,在地址栏中输入 192.168.1.102

【讨论】:

    猜你喜欢
    • 2018-06-18
    • 2012-10-08
    • 2011-01-01
    • 2013-12-16
    • 2011-02-18
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多