fixed createpage and added the database insert (aslong as there is no stored procedure)