NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
For loop causing page reloads/infinite loop


Joined: 29 Jul 2005
Posts: 7
Reply with quote
For some reason the following code is causing a page I'm debugging to reload and start the debug session all over again, causing an infinite loop.
The value of $regs is a SQL date.
<?php
$date = explode('-',$regs[0]);
for( $i = 1; $i < 12; $i++ )
{
?>
<option value="<?= $i ?>"
<?php
if( $i == $date[1] )
{ print " selected"; }
?>
><?= $i ?></option>
<?php
}
?>
</select>&nbsp;

For some reason, when the $i reaches 11, the debugger reloads the page.
Confused Sad
View user's profileFind all posts by jjirsaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
It may depend on the HTML and JavaScript you have in the file.
At some point, IE starts parsing HTML and executing the code even if the document is not complete. So if you have any "meta reload" or "
"document.location" statements, they may trigger browser to reload the page or forward to another location which subsequently trigger new debug session. Also it's possible that current debug session was timeouted by the browser. I'd recommend you to use breakpoints to execute your code faster.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jul 2005
Posts: 7
Reply with quote
But, this happens even when I single step through the code.
View user's profileFind all posts by jjirsaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Look at the web server logs.
I think the answer is there.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
For loop causing page reloads/infinite loop
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic