复制代码 代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>投票结果</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function checkajax(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("您的浏览器不支持AJAX!");
return ;
}else
{
return xmlHttp;
}
}
function preshow(){
ajaxobj = checkajax();
var url = "page.php?page=1";
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint1(str)
{
ajaxobj = checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint2(str)
{
ajaxobj=checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint3(str)
{
ajaxobj=checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint4(str)
{document.getElementById("msg").style.display="none";
ajaxobj=checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("message").innerHTML=xmlHttp.responseText;
}
}
</script>
</head>
<body onload="preshow()">
<div id="wrapper">
<h4>用户留言如下:</h4>
<div id="message">
</div>
</div>
</body>
</html>
复制代码 代码如下:
<?php
$link = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('vote', $link) or die(mysql_error());
mysql_query("set names utf8");
$num = 3;
$url = "page.php";
$con = "<ul id='msg'>";
$page = (isset($_REQUEST['page'])) ? $_REQUEST['page'] : 1;
$offset = ($page - 1) * $num;
$result = mysql_query("SELECT COUNT(*) FROM client");
$total = mysql_fetch_row($result);
$total = $total[0];
$pagenum = ceil($total / $num);
$page = min($pagenum, $page); //获得首页
$prepg = $page - 1; //上一页
if ($prepg <= 1)
$prepg = 1;
$nextpg = ($page == $pagenum ? 1 : $page + 1); //下一页
//如果只有一页则跳出函数:
if ($pagenum <= 1)
return false;
$sql = "SELECT `name`,`content` FROM `client` LIMIT " . $offset . "," . $num;
$res = mysql_query($sql);
while ($content = mysql_fetch_row($res)) {
$con .= "<li><span>$content[0]:</span> $content[1]</li>";
}
$con .= "</ul>";
$con .= <<< PAGE
<p id="page"><a href="#" id="first" onclick="showHint1('$url?page=1')">首页</a>|<a href="#" id="pre" onclick="showHint2('$url?page=$prepg')">上一页</a>|<a href="#" id="next" onclick="showHint3('$url?page=$nextpg')">下一页</a>|<a href="#" id="last" onclick="showHint4('$url?page=$pagenum')">尾页</a></p>
PAGE;
echo $con;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>投票结果</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function checkajax(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("您的浏览器不支持AJAX!");
return ;
}else
{
return xmlHttp;
}
}
function preshow(){
ajaxobj = checkajax();
var url = "page.php?page=1";
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint1(str)
{
ajaxobj = checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint2(str)
{
ajaxobj=checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint3(str)
{
ajaxobj=checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function showHint4(str)
{document.getElementById("msg").style.display="none";
ajaxobj=checkajax();
document.getElementById("msg").innerHTML="正在读取数据……";
var url = str;
ajaxobj.onreadystatechange=stateChanged;
ajaxobj.open("GET",url,true);
ajaxobj.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("message").innerHTML=xmlHttp.responseText;
}
}
</script>
</head>
<body onload="preshow()">
<div id="wrapper">
<h4>用户留言如下:</h4>
<div id="message">
</div>
</div>
</body>
</html>
复制代码 代码如下:
<?php
$link = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('vote', $link) or die(mysql_error());
mysql_query("set names utf8");
$num = 3;
$url = "page.php";
$con = "<ul id='msg'>";
$page = (isset($_REQUEST['page'])) ? $_REQUEST['page'] : 1;
$offset = ($page - 1) * $num;
$result = mysql_query("SELECT COUNT(*) FROM client");
$total = mysql_fetch_row($result);
$total = $total[0];
$pagenum = ceil($total / $num);
$page = min($pagenum, $page); //获得首页
$prepg = $page - 1; //上一页
if ($prepg <= 1)
$prepg = 1;
$nextpg = ($page == $pagenum ? 1 : $page + 1); //下一页
//如果只有一页则跳出函数:
if ($pagenum <= 1)
return false;
$sql = "SELECT `name`,`content` FROM `client` LIMIT " . $offset . "," . $num;
$res = mysql_query($sql);
while ($content = mysql_fetch_row($res)) {
$con .= "<li><span>$content[0]:</span> $content[1]</li>";
}
$con .= "</ul>";
$con .= <<< PAGE
<p id="page"><a href="#" id="first" onclick="showHint1('$url?page=1')">首页</a>|<a href="#" id="pre" onclick="showHint2('$url?page=$prepg')">上一页</a>|<a href="#" id="next" onclick="showHint3('$url?page=$nextpg')">下一页</a>|<a href="#" id="last" onclick="showHint4('$url?page=$pagenum')">尾页</a></p>
PAGE;
echo $con;
?>
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年11月18日
2024年11月18日
- 林子祥《单手拍掌》华纳香港版[WAV+CUE][1G]
- 郑秀文.1997-我们的主题曲【华纳】【WAV+CUE】
- 群星.2001-生命因爱动听电影原创音乐AVCD【MEDIA】【WAV+CUE】
- 林志颖.1994-别了晴雨的回忆【飞碟】【WAV+CUE】
- 群星《经典咏流传2》限量1:1母盘直刻[低速原抓WAV+CUE]
- 【蓝卡唱片】卫海霞《乐海霞音珍藏版》WAV分轨
- 杨小琳《金装杨小琳》24K金碟特别版[低速原抓WAV+CUE]
- 群星《国风超有戏 第8期》[320K/MP3][30.32MB]
- 群星《国风超有戏 第8期》[FLAC/分轨][157.37MB]
- 群星《说唱梦工厂 第10期》[320K/MP3][99.5MB]
- 李嘉.1996-思念过秋冬【点将】【WAV+CUE】
- 汪峰.2009-信仰在空中飘扬【星文】【WAV+CUE】
- 尤长靖.2023-肆无忌惮的恋人(EP)【FLAC分轨】
- 群星《说唱梦工厂 第10期》[FLAC/分轨][544.11MB]
- 群星《歌手2024 第12期》[320K/MP3][105.71MB]