form.html
<form action="check_form.php" method="post">
<input type="text" name="username">
<input type="button" name="email">
<input type="text" name="sex">
<input type="submit" name="verify" value="Submit">
</form>
check_form.php
<?php if (isset($_POST['verify'])) {
?>
<form action="check_form.php" method="post">
<input type="text" name="username" value="<?php echo $_POST['username']; ?>">
<input type="button" name="email" value="<?php echo $_POST['email']; ?>">
<input type="text" name="sex" value="<?php echo $_POST['sex']; ?>">
<input type="submit" name="finished" value="Yes, this is correct">
</form>
<?php
}
db_connect(); // database connect function here
if (isset($_POST['finished'])) {
$sql = "INSERT INTO table (col1, col2, col3)
VALUES (" . $_POST['username'] . "
" . $_POST['email'] . "
" . $_POST['sex'] . ")";
$result = mysql_query($sql);
}
?>
This should work but I've not tested it. Do a search on the site for foms and variables. You'll get loads of stuff.