Updated code.
http://pastebin.com/0BR5Z9cQ
View the calculator here
http://runehints.com/combat2
Use Gaogier - to test it.
Everything works all but the levels required to level up a combat level (at the bottom after you calculated it and it has "

" in its place.
Here is the combat formula again.
Defence + 2 + highest level out of Attack, Strength, Magic, Ranged, Summoning.
I need help working out the following formula into php.
combat level - level - 2 - def level - target level (either attack, strength, magic, ranged, summoning + 1
PHP Code:
echo combatLevel($_POST['attack'], $_POST['defence'], $_POST['strength'], $_POST['ranged'], $_POST['magic'], $_POST['summoning']);