php分页不用get用post代码示例
<a href='<?=$_SERVER['PHP_SELF'];?>?page=1'>1</a>
<a href='<?=$_SERVER['PHP_SELF'];?>?page=2'>2</a>
....
<form id="myform" method="post" name="myform" action="<?=$_SERVER['PHP_SELF'];?>">
<input type="hidden" name="page" id="page" value="" />
</form>
<a href="#" onclick="mylink(1)">1</a>
<a href="#" onclick="mylink(2)">2</a>
....
<script language="JavaScript">
function mylink(page)
{
document.getElementById('page').value = page;
document.myform.submit();
}
</script>
<?php
echo '<br />get page=' . $_GET['page'];
echo '<br />post page=' . $_POST['page'];
?>
【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。