php : 看书网页 : 上一页,下一页
get.php
<?php $dir= $_GET["dir"]; $pre= $_GET["pre"]; $end= (integer)$_GET["end"]; $i= (integer)$_GET["i"]; $i1 = $i -1; $i2 = $i +1; $s = sprintf("%03d", $i); $path=$dir."/".$pre.$s.".jpg"; ?> <html> <head> <base target="top"/> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <title>IT Books </title> <style type="text/css"> body {background:#FFFFFC;} </style> </head> <body> <?php if($i>1){ echo '<a href="get.php?dir='.$dir.'&pre='.$pre.'&end='.$end.'&i='.$i1.'" >上一页</a> '; } else { echo '这是首页'; } echo " \n"; echo '<a href="'.$dir.'.htm" >中文目录</a>'." \n"; if($i< $end){ echo '<a href="get.php?dir='.$dir.'&pre='.$pre.'&end='.$end.'&i='.$i2.'" >下一页</a>'."\n"; } else { echo '这是尾页'; } ?> <p> <img src="<?echo $path;?>" alt="<?echo $path;?>"/> </p> <?php if($i>1){ echo '<a href="get.php?dir='.$dir.'&pre='.$pre.'&end='.$end.'&i='.$i1.'" >上一页</a> '; } else { echo '这是首页'; } echo " \n"; echo '<a href="'.$dir.'.htm" >中文目录</a>'." \n"; if($i< $end){ echo '<a href="get.php?dir='.$dir.'&pre='.$pre.'&end='.$end.'&i='.$i2.'" >下一页</a>'."\n"; } else { echo '这是尾页'; } ?> </body> </html>
相关推荐
MXstudying 2020-09-05
WasteLand 2020-09-15
<?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh
mathchao 2020-09-15
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
Noneyes 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28