aoming认为到目前为止,问题已有明确答案,本贴已被冻结,不再接受更多的回复 <? //基本设定 $server = "localhost"; $username = "root"; $password = "netwenk"; $ser_dababase = "netwenk"; //------------------------------------------------------------------------------------------------------------------------- $mylike = mysql_connect($server,$username,$password) or die("数据库连接失败!"); $sql = "INSERT INTO `counter` ( `new`)VALUES ( '1' )"; mysql_select_db($ser_dababase); $result = mysql_query($sql);
//------------------------------------------------------------------------------------------------------------------------- $mylike = mysql_connect($server,$username,$password) or die("数据库连接失败!"); $sql = "SELECT count(*) FROM `counter`WHERE 1 "; mysql_select_db($ser_dababase); $result = mysql_query($sql); $coun = mysql_fetch_row($result);
?>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>超级简单计数器</title> <style type="text/css"> <!-- .STYLE1 {font-size: 36px} .STYLE2 {color: #00FF00} .STYLE3 {color: #FF0000} body,td,th { color: #FFFFFF; } body { background-color: #CCCCCC; background-image: url(); background-repeat: no-repeat; } --> </style> </head>
<body> <p align="center">开站至今已有<?=$coun[0] ?>人访问</p> </body> </html>
[此贴被 天枫(lqfrla) 在 03月10日19时48分 编辑过]
|