Php+ajax real-time automatic detection of whether the network method, Ajax real-time
This paper describes the method of Php+ajax real-time automatic detection of Internet connection. Share to everyone for your reference. The implementation method is as follows:
HTML Part code:
Php+ajax real-time automatic detection of connectivity
Php+ajax real-time automatic detection of connectivity
Current network status:
PHP Section Code:
Public Function Getnetlink () { header ("Cache-control:no-cache,must-revalidate"); Header ("Content-type:text/html;charset=utf-8"); $file =fopen ("http://www.baidu.com/", "R"); if (! $file) { $shownetlink = "network connection failed"; } else{ $shownetlink = "network connection OK"; } Echo $shownetlink; }
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1024912.html www.bkjia.com true http://www.bkjia.com/PHPjc/1024912.html techarticle Php+ajax Real-time automatic detection of whether the network of methods, Ajax real-time in this paper, Php+ajax real-time automatic detection of the network method. Share to everyone for your reference. Concrete Implementation Method ...