Basically, one of your loops is never ending. You've made an infinite loop.
A few things you should fix, and that may (or may not) fix your problem.
1) Use && as the AND operator. & is the bitwise AND operator, and doesn't function the way you want it to (in your case).
2) This line:
PHP Code:
} while ($set==2 & $monsterhealth>0){
Should be split into two, like so:
PHP Code:
}
while ($set==2 & $monsterhealth>0){
Don't close a loop and start one on the same line. The way you have it is the way you write the condition for a DO WHILE loop, when you're using a regular WHILE loop.
3) Indent your code! I don' know if it's just because you copy/pasted it or whatever, but if you don'T indent your code, make sure you do. Especially when using loops. Makes it a LOT easier to see what's going on.
4) When getting wariables using the $_GET superglobal, put the index name in '' (so $_GET['foo']), and capitalize the GET. It's just a standard practive to capitalize constants and system vars in this case.
5) You're starting a session at the top, but aren't setting any variables. Why's this?
Let me know if any of that helped (or didn't).
------------------------ FOOBAR EDIT -------------------------
I found the problem. In your first loop, you have the player attacking the monster. Thus, you should be checking the monsters health. Instead, you're checking the player health in your if statement.
------------------------ /FOOBAR EDIT -------------------------