大家好,我正在使用此脚本进行分页:
<?php
if(isset($_GET['page']) && $_GET['page'] != '') {
$pageno = $_GET['page']; /* Sanitize Here */
} else {
/* You can redirect user to home page */
}
?>
<?php
if(isset($pageno)) {
if($pageno == '1') {
?>
<div class="container">
<div class="examples">
<div class="row">
<div class="span3">
<img id="one" src="img/example.png"/>
</div>
<div class="span3">
<img id="two" src="img/example.png"/>
</div>
<div class="span3">
<img id="three" src="img/example.png"/>
</div>
<div class="span3">
<img id="four" src="img/example.png"/>
</div>
</div>
<br />
<div class="row">
<div class="span3">
<img id="one" src="img/example.png"/>
</div>
<div class="span3">
<img id="two" src="img/example.png"/>
</div>
<div class="span3">
<img id="three" src="img/example.png"/>
</div>
<div class="span3">
<img id="four" src="img/example.png"/>
</div>
</div>
<br />
<div class="row">
<div class="span3">
<img id="one" src="img/example.png"/>
</div>
<div class="span3">
<img id="two" src="img/example.png"/>
</div>
<div class="span3">
<img id="three" src="img/example.png"/>
</div>
<div class="span3">
<img id="four" src="img/example.png"/>
</div>
</div>
<br />
<div class="pages">
<div class="prev-blocked"></div>
<a href="portfolio.php?page=2"><div class="next"></div></a>
<br /><br /><br />
</div>
</div>
<?php
}
elseif($pageno == '2') {
?>
<div class="container">
<br />
<div class="alert alert-error">
<b>Opps!</b> We could not find out the page you're requesting. <a href="index.php">Go back</a>
</div>
</div>
<!--
<div class="container">
<div class="examples">
<div class="row">
<div class="span3">
<img id="one" src="img/example.png"/>
</div>
<div class="span3">
<img id="two" src="img/example.png"/>
</div>
<div class="span3">
<img id="three" src="img/example.png"/>
</div>
<div class="span3">
<img id="four" src="img/example.png"/>
</div>
</div>
<br />
<div class="row">
<div class="span3">
<img id="one" src="img/example.png"/>
</div>
<div class="span3">
<img id="two" src="img/example.png"/>
</div>
<div class="span3">
<img id="three" src="img/example.png"/>
</div>
<div class="span3">
<img id="four" src="img/example.png"/>
</div>
</div>
<br />
<div class="row">
<div class="span3">
<img id="one" src="img/example.png"/>
</div>
<div class="span3">
<img id="two" src="img/example.png"/>
</div>
<div class="span3">
<img id="three" src="img/example.png"/>
</div>
<div class="span3">
<img id="four" src="img/example.png"/>
</div>
</div>
<br />
<div class="pages">
<a href="portfolio.php?page=1"><div class="prev"></div></a>
<div class="next-blocked"></div>
<br /><br /><br />
</div>
</div>
-->
<?php
}
}
?>
你能看到线吗
elseif($pageno == '2') {
表示页面 .php?page=2 会显示下面的内容
我想让它使高于数字 2 的每个页面都显示相同的页面。
我试过这些选项:
elseif($pageno == '>=2') {
elseif($pageno == '>2') {
它们都不起作用,甚至没有错误。我怀疑您可以使用该脚本以这种方式执行某些操作,但是,还有其他方法可以做到吗?
谢谢。