Sounds like you want to learn a lot of web based languages. I would recommend learning MySQL (or similar) Json, and Ruby on Rails. The order you plan on going in seems pretty good. PHP can be used hand in hand with MySQL (or similar), so that is the reasoning behind the suggestion.
I don't care how ‘secure’ your systems are. If you have stupid people running them and using them, you can't win.
For those that know