merge index.php with insert.php and add validate