Not sure what you mean 'loaded into [your] variables', but one problem I see is this:
// insert the user and date.
include 'db.php';
$con;
$mydb;
$dbname;
$sql2;
$result;
$myinsert2;
exit()
Other than including db.php, that code doesn't do anything. You've just got a list of variable names, but you don't assign any values to them or use their values or do anything at all to them. It's essentially the same code as this:
include 'db.php';
exit();
EDIT: Some other problems...
close($con);
header ("locate: ./Topten/topten.php");
AFAIK, there is no such HTTP header called "Locate" - perhaps you meant "Location:" instead? In addition, there is no such function called close().
You've also got the same issue as above here:
$sdata;
Again, that code does absolutely nothing.