To be slightly less arsey, here's a couple of brief criticisms:
You are using the deprecated mysql_ functions. Stop it.
Your code is wide open to sql injection attacks. Read up on them. I reckon I could wipe your database just by passing a certain query to your url. You need to understand why this is possible and what you can do to prevent this (best solution: start using prepared statements in PDO at the very least. Even better, use something like Doctrine 2, but this is probably beyond you right now. Google PDO prepared statements).
You are mixing presentation logic (html and css) with your business application logic. This will make it a nightmare to redesign the look of your site in the future. Look into MVC (model view controller) for a good way to start improving this.
You are including files in the middle of your script. You should barely need to use include and require statements anymore - look into autoloading for this. Even better, look into composer and namespaces. Google this stuff yourself.
Your code is very poorly indented, which also makes it horrible to read. Learn how to indent your code so it's not painful to read through.
You have pointless comments that should be removed. Learn how to use phpdoc style comments instead.
You've also got inline css all over the place (bad news because again, it will make your site much harder to redesign, or to just move things about a bit on the page etc - you shouldn't really use inline css at all if you can help it).
Also, go to this site and READ it. It will make you a far, far better developer. You can start by looking at the database stuff and take it from there: http://phptherightway.com
There. I did more than just say your code is crap. I feel slightly better now.