I cannot find the problem, Once you reach the level 1624-5 it starts giving negative exp and automatically levels up.
exp line in header.php
$experc=(int) ($ir['exp']/$ir['exp_needed']*100);
check_level global func.php
function check_level()
{
global $db;
global $ir,$c,$userid;
$ir['exp_needed']=(int) (($ir['level']+2)*($ir['level']+2)*($ir['level']+2)*0.5);
if($ir['exp'] >= $ir['exp_needed'])
{
$expu=$ir['exp']-$ir['exp_needed'];
$ir['level']+=1;
$ir['exp']=$expu;
$ir['brave']+=2;
$ir['maxbrave']+=2;
$ir['hp']+=50;
$ir['maxhp']+=50;
$ir['exp_needed']=(int) (($ir['level']+2)*($ir['level']+2)*($ir['level']+2)*0.5);
$db->query("UPDATE users SET level=level+1,exp=$expu,brave=brave+2,maxbrave=maxbrave+2,
hp=hp+50,maxhp=maxhp+50,mlevel=mlevel+1 where userid=$userid");
}
}