PHP 5 causing looping problems?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Pookie
-


Joined: 05 Jan 2005
Posts: 60
Location: Citrus Heights, CA

PostPosted: Sat Apr 28, 2007 8:26 am    Post subject: PHP 5 causing looping problems? Reply with quote

I used alot of different popular php written scripts for my webpages and over time and sometimes right away, im gettin a looping page problem. Like on phpbb it wont let me get to the admin page, and with other programs the sign-on page starts looping with i tried to sign into it. So i stopped using alot of the stuff that i wanted to use because of this looping problem me and others are having.

I was wondering if its possible that its a setting i got to change in my php5 pre-package script to fix this problem? or maybe its the MySQL 5.0 thats causing problems?

I got the latest version of Abyss

MySQL 5.0
PHP 5

not all my webpages have this problem tho. its weird because out of all the help i got nobody can seem to find the problem. i dont wanna degrade anything, but if i have to do that to get things to work correctly then i will.

Thanks
_________________
~TRU~
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Apr 28, 2007 1:00 pm    Post subject: Reply with quote

Hello pookie,

If you don't properly write the conditional within a loop, it will loop on forever or display an error about the memory usage running out.

Example:

Code:
<?php
for ($n=0; $n < 10; $n--)
{
    echo "This will loop on forever because it will always be less than 10.<br />";
}
?>


The proper way.

Code:

<?php
for ($n=0; $n < 10; $n++)
{
    echo "This will loop 10 times before it stops.<br />";
}
?>


You should always make sure your condition works before using a loop or it will loop on forever. In example one, I forgot to increase the value of $n each time it loops around. Since I failed to do so, the condition looped forever because I decreased the value of $n instead of increase it.
Back to top View user's profile Send private message Visit poster's website
Pookie
-


Joined: 05 Jan 2005
Posts: 60
Location: Citrus Heights, CA

PostPosted: Sun Apr 29, 2007 9:38 am    Post subject: Reply with quote

i didnt write any of the php coding for my xoops program, or inside of my php.ini file. so maybe its some kind of bug inside of the programs php writting itself since i found out alot of others are having the same problem with pages looping when they're not suppose to.
_________________
~TRU~
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sun Apr 29, 2007 10:00 am    Post subject: Reply with quote

You should contact the person that wrote the code and tell them about it. Be sure to include the Full PHP Version your using (5.2.1 etc.).
Back to top View user's profile Send private message Visit poster's website
Pookie
-


Joined: 05 Jan 2005
Posts: 60
Location: Citrus Heights, CA

PostPosted: Mon Apr 30, 2007 8:14 am    Post subject: Reply with quote

well right now its to the point where it cant be anything wrong with the program im using because i installed a different program today and i got a page on there that loops also. it doesn't do anything but refreshes the page when a user tries to sign in. so im guessing its something thats on my system, or my whole network at that since im getting the same errors from my laptop when i visit the site. Im just stuck right now.
_________________
~TRU~
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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


Powered by phpBB phpBB Group