I have nearly completed a website that i have been working on since march. The site is looking pretty good and everything works properly but for a few months now i've been getting problems with the site being slow and sometimes taking up to 15 minutes to load a page I have managed to locate where this slowness is happening and there seems to be 2 scripts that are causing it. Now i don't know how I can increase the speed of them because i just code, i don't ever try to reduce execution time of scripts or anything like that. Could anyone assist me with this? Sorry but i can't offer money for it since i can't afford to but maybe you can think of some other way i can repay you. Here are the scripts that are causing my site to be slow:
I keep getting the error: Maximum execution time of 30 seconds exceeded in e:\domains\s\staticfire.co.uk\user\htdocs\index.ph p on line 4 quite often and on line 4 is this:
Another issue is with the script to show active users on the site. It is actually setup using ajax and a timer which updates it every 10 seconds. After about a minute it will just freeze and stop working and i don't understand why. I tried removing each query and i managed to find that it was this one causing the problem:
PHP Code:
$result = mysql_query("UPDATE active SET time=CURTIME(),timeout=ADDTIME(CURTIME(), '00:10:00') WHERE loginname='$loginname'")
or die(mysql_error());
If anybody knows why either of those scripts are causing my site to go extreamly slow or what can be done to stop the slowness the please reply. Also if you need me to provide any more information so you can help then please ask.