Quite simple:
Code:
<?php
if(!isset($preview) || (isset($preview) && $preview == 1))
{
if(isset($preview))
{
echo "your current issue is:<br>
some setup of how the $whatever_fieldnames should be shown";
}
else
$preview =0;
echo "
<form action='$PHP_SELF' method=post>
<input type=hidden value='$preview+1' name='preview'>
<input type='text' name='some_field' value='$some_field'>
<!-- and so on with the rest of the fields used -->
<input type=submit></form>
";
}
else
{
/* $preview must be > 1
thus its a second submission.
*/
$DB=mysql_connect("localhost", "user", "passwd");
mysql_select_db("some_db");
mysql_query("INSERT INTO whatever VALUES (some_field='$some_field' ...)", $DB);
header("Location: /what/ever/page.php");
}
?>
Only one page for everything, only drawback for this one, is, theres only one preview, uppon seccond submit you'll have the entry parsed onto your sql database. But then again you're forcing the user to have that one preview.
Or did I missunderstood your question? In this, the user will uppon submit, be shown a preview, he can chose to change something in it, or leave as it is, and just press submit again, which will store the info in your database. It needs some error checking, but for a fast one, it covers the aspects.