Your test of
if(isset($_POST['submit']))
will always pass in that an input control of type 'submit' should not have (or be tested) for a value - it's job is to send the contents of the form to the target of action="inset.php". Since you hard-coded a value it will always have one.
Also, not knowing what is in "db.php" or "config.php", I don't know if you're connecting to a database with $db= new database(); Do you even have a connection parameters? Can you retrieve data from the table so you at least know you have a connection?
If you simply cut/pasted these from some online source then there's essentially no chance they'll work for you since your setup will have different locations, credentials, and everything else.
(without understanding, cut/paste = waste)