<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>number_squareing</title>
<style type="text/css">
th { text-align: left; background-color: #999; }
th, td { padding: 0.4em; }
tr.alt td { background: #ddd; }
</style>
</head>
<body>
<?php
define("PAGE_SIZE" , 10);
$start = 0;
if(isset($_GET["start"]) and $_GET["start"] >= 0 and $_GET["start"] <=100000 )
{
$start = (int) $_GET["start"] ;
}
$end = $start + PAGE_SIZE - 1;
?>
<h2>数字的平方</h2>
<P>下面是从<?php echo $start ?>到<?php echo $end ?>的平方和,欢迎查看!</p>
<table cellspacing="0" border="0" style="width: 20em; border: 1px solid #666;">
<tr>
<th width="91"> N </th>
<th width="90">N<sup>2</sup></th>
</tr>
<?php
for($i= $start;$start <= $end;$i++)
{
?>
<tr <?php if ($i % 2 != 0 ) echo 'class = "alt"'?>>
<td><?php echo $i; ?></td>
<td><?php echo pow( $i, 2 ); ?></td>
</tr>
<?php
}
?>
</table>
<p>
<?php if($start > 0 ) { ?>
<a href="number.php?start=<?php echo $start - PAGE_SIZE ?>"><Previous Page</a> |
<?php } ?>
<a href="number.php?start =<?php echo $start + PAGE_SIZE ?>">Next Page ></a>
</p>
</body>
</html>
这个代码一直执行不完,怎么回事,求解答!
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。