PHP static HTML page statistics browser instance code
News.html
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> record the number of visits </title>
<Script type = "text/javascript">
Function getProfile (str ){
Var arr = str;
Alert (str );
Document. getElementById (nick). innerHTML = arr;
}
</Script>
</Head>
<Body>
<Div id = "nick"> </div>
<Script type = "text/javascript" src = "act. php"> </script>
</Body>
</Html>
Act. php
<? Php
$ Db = mysql_connect (localhost, root, 123456) or die ("database connection failed ");
Mysql_select_db (zend, $ db );
Mysql_query ("set names utf8 ");
Mysql_query ("update info set msg = msg 1 where id = 1 ");
$ SQL = "select msg from info where id = 1 ";
$ Rs = mysql_query ($ SQL );
$ Row = mysql_fetch_array ($ rs );
$ Str = $ row [msg];
$ Json_string = $ str;
Echo "getProfile ($ json_string );";
?>