My understanding of memory in a computer is that it is stored in blocks that are over written only when the computer finds it convenient. so if a program asks to write in a certain block rather than clearing that block, which takes time, the computer will just redefine where that block is so that it can use an empty block and worry about clearing other blocks latter. This is fine but with password storage that means (if I understand correctly) that even though a password may be stored in encrypted form, a non-encrypted form of the password is lying around somewhere in the "uncleared" part of my computers memory.

Please explain to me either why this is not the case or why this is not a security issue. Thanks for the help.

Try sending a HEAD request.

I'm assuming that with ascii.txt included, the output of the script is just over a nice number like 4096 bytes, a common output_buffering value. Once the script has written output_buffering bytes, it needs to flush the output buffer before continuing.

Normally this works fine and the script continues, but if the request type is HEAD, there's nowhere for the output to go and execution stops, hopefully in the middle of the "wrong password" message which means admin_level is never set back to 0.

If ascii.txt is a file you can control, you'll have to tweak the size so the numbers work out to exceed output_buffering while writing the "wrong password" message.

Here's a paper on this technique. It might not always be applicable based on the PHP version/config, but the last example in the paper is so similar to this problem that I'd expect it to be the intended solution.
