OK, I'll try to answer some of those, but I'm gonna move this into, um, Chit Chat, for lack of a better place. You'll be more likely to get help from people there than in this forum...
UBB is written in Perl, which is one kind of CGI. UBB uses flat-file text databases for it's storage, but it is possible to use actual databases like MySQL for it, too. PHP, from what I've heard, is only a front-end language, and it's really good with MySQL databases. (Though I'm sure it could use flatfile ones if it needed to.) ASP is something Microsoft created that was fairly popular when it first was invented, but more people use PHP/MySQL now.
Any language will have it's own particular drawbacks. The languages themselves usually don't have security problems, but it's the programs you write that have the potential to cause security problems. So no matter which language you choose, you're still likely to run into some bugs or problems or security issues eventually.
And with that, I'm gonna move this into Chit Chat. (Anyone feel free to correct me if I'm wrong on that stuff.
)
---Skorpion