Some changes I needed to do to get yubikey-ksm to work with SQLite. [...]

Also, some cosmetic changes, some semi-religious changes (GET/REQUEST), some php notice fixes and use a prepared statement instead of a direct query (I like the way you can fix a maximum length to a parameter with bindParam). Apologies if I didn't completely follow the indenting and bracing style, I did my best.