Please attach the .php page so I can open it in Dreamweaver instead of using copy/paste in the future.
I see your recordset uses $_SESSION['UserID'] and your insert uses $_POST["userid"]
That may be the issue.
Also you are validating the value of:
but with MySQLi the syntax should be:
I think everything else looks correct.