I am using a form to enter data into a mysql database that will be output as an article. Before the data is submitted there is a preview page. However, the preview page shows the information twice. But it only goes in the database once. And I have no idea why!
Here is the code if you have the time. Maybe you can spot something! Thanks!
Kathy
$Query = "SELECT *, DATE_FORMAT(date, '%m-%d-%Y') AS date_format FROM articles where article_id = '$article_id'";
$Result = mysql_db_query ($DBName, $Query, $Link);
$Row = mysql_fetch_array($Result);
echo mysql_error();
$body = stripslashes($body);
$intro = stripslashes($intro);
$heading = stripslashes($heading);
{
print ("<TABLE BORDER=0 WIDTH=\"100%\" CELLSPACING=1 CELLPADDING=2 ALIGN=CENTER>");
print ("<TR>");
print ("<TD ALIGN=center VALIGN=TOP><font size=3 face=Arial, Helvetica, sans-serif><b>$heading</b></font></TD>");
print ("</TR>");
print ("<TR>");
print ("<TD ALIGN=left VALIGN=TOP><font size=2 face=Arial, Helvetica, sans-serif>$body</font></TD>");
print ("</TR>");
}
print ("</TABLE>");
print ("<form action=articlesin.php method=POST>");
print("<input type=hidden name=heading value=\"$heading\">");
print("<input type=hidden name=body value=\"$body\">");
print("<input type=hidden name=date value=\"$date\">");
print("<input type=hidden name=author_name value=\"$author_name\">");
print("<input type=hidden name=author_email=\"$author_email\">");
print("<input type=hidden name=subject value=\"$subject\">");
print("<input type=hidden name=intro value=\"$intro\">");
print ("<P><P><P><a href=\"javascript:history.back()\"
onmouseover=\"window.status='back up one page';\"
onmouseout=\"window.status=' ';\"><CENTER><HR><B>Click here to go back and make some changes or corrections</b></CENTER></a>
<br>");
print("<center><input type=\"submit\" name=\"submit\" value=\"Submit to Articles Database and to enter a new article\">");
print ("</form></center>");