我有点有趣的问题。在添加if声明到我的while循环带有PHP函数后,运行该站点的我的(Chrome)浏览器窗口将不会响应。我已经验证,如果声明通过注释导致问题,那么这是一个。如果声明已注释掉,则所有内容均会加载。为什么“if”语句导致“while”循环冻结浏览器?
结果与两个循环相同。
function disp_editForm($id, $day, $month, $year, $type, $content) {
$d_count = 0;
$m_count = 0;
echo '<select name="editDay" id="editDay" onchange="" size="1">';
while($d_count<31) {
$d_count++;
if($d_count=$day) { $dSelected = "selected"; } // Select value in the drop box
echo '<option value="'.$d_count.'"'.$dSelected.'>'.$d_count.'</option>';
} // End Day While Loop
echo '</select>';
echo '<select name="editMonth" id="editMonth" onchange="" size="1">';
while($m_count<12) {
$m_count++;
if($m_count=$month) { $mSelected = "selected"; } // Select value in the drop box
echo '<option value="'.$m_count.'"'.$mSelected.'>';
mConvert($m_count); // Convert month number into a word
echo '</option>';
} // End Month While Loop
echo '</select>';
}
你做一个分配在你的if语句! – Rizier123