Page 1 of 1

Record added twice?

Posted: Thu Sep 15, 2005 12:13 pm
by ianhull
Hi guys,

I am inserting some content into the db but is seems to be entered twice.

Anyone know why?

Code: Select all

<?php session_start();
include_once("connect.php");
$sletter = $_POST['letter'];
$title = $_POST['title'];
$details = $_POST['inpContent'];
$addedby = $_SESSION['username'];
$added = date('l dS \of F Y h:i:s A');
$insert = "INSERT INTO `procedures` (`Letter`, `Title`, `Details`, `Addedby`) VALUES ('$sletter', '$title', '$details', '$addedby') ";
mysql_query($insert) or die(mysql_error());
exit();
?>

Posted: Thu Sep 15, 2005 12:41 pm
by shiznatix
is the the entire code for the page? are you hitting submit twice?

[SOLVED]

Posted: Thu Sep 15, 2005 12:42 pm
by ianhull
I had my submit button on the previous page inside the form tage meaning it was submitted twice.

:oops:

Posted: Thu Sep 15, 2005 1:38 pm
by ryanlwh
i don't see having a submit button on the previous page would make you submit this page twice, unless this page submits to itself again.