开发者社区> 问答> 正文

这个脚本一直执行不完

<!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 ?>">&lt;Previous Page</a> |
<?php  } ?>
    <a href="number.php?start =<?php echo $start + PAGE_SIZE ?>">Next Page &gt;</a>
 </p>
</body>
</html>

这个代码一直执行不完,怎么回事,求解答!

展开
收起
吴孟桥 2016-06-07 18:40:08 2287 0
1 条回答
写回答
取消 提交回答
  • for($i= $start;$start <= $end;$i++)
    {
    //看得出来了吗?$start的值
    }

    2019-07-17 19:30:44
    赞同 展开评论 打赏
问答分类:
PHP
问答地址:
问答排行榜
最热
最新

相关电子书

更多
15分钟打造你自己的小程序 立即下载
小程序 大世界 立即下载
《15分钟打造你自己的小程序》 立即下载