Mark, now that you have you code entered in the right order, what part of it is failing? Have you verified that you have made the connection to the database? Have you tried running the INSERT query directly in MySQL? Does that work?
You are not very consistent in your methods. At first, you set a $sql variable, then set $result = your query. Later, you simply run mysql_query with the SQL statement. Keep using your variables, and echo them to the screen so you can see where your code is failing. If it is indeed the INSERT query, then you can investigate the problem in MySQL -- perhaps you don't have the proper permissions for the user, for example.
You can't simply say "it's not working" and expect us to know just by looking at your code. If there were something glaringly wrong with the code, perhaps we could help you spot it, but the problem can be in many different areas. Investigate and pinpoint where the problem is occuring, and if you need help, be sure to let us know what you did to try to discover the problem.
Hope that sets you in the right direction... Good Luck!