Regarding your security code
I'm glad to see that you have some defenses in place so that you are not completely vulnerable.
That being said, having one (or more) input filter functions in place is not really a good approach to security. It will catch some attacks (maybe even most), but there are always cases where it will not work.
It will also lead to usability problems and bugs, which isn't good, but not necessarily your main concern. Still, these bugs can have security implications. For example, my super secure password i<3super_secure_passwords
becomes the way less secure i
for your website (because of strip_tags).
You are also still vulnerable to XSS. strip_tags
doesn't work when you are already in a tag, eg here: <input name=\"game_name\" size=\"20\" value=\"$game_name\" />
($game_name
is user supplied, and an attacker can add additional attributes to get into a JavaScript context).
Allowing your mods to post any tags is also not a good idea, as they can relatively easily escalate their privileges to admin. You don't need to write some kind of filter yourself (and you shouldn't, as it's quite difficult), just use an existing library, eg HTML Purifier.
Regarding SQL injection, the code you posted is probably safe (although strongly discuraged; there is a reason that magic quotes isn't enabled by default anymore), but if you have queries where user input is not surrounded by quotes, it will not work (eg when passing ids, when using limit, etc).
Also, don't store passwords in cookies, and make cookies httpOnly.