Page creating database entry when it reloads or when you go to it when using a mysql query. I have it set up so when you hit submit it inserts the data into the database but for some reason on a page reload or even when you go to it, it creates yet another database entry without hitting submit.
<?php
$con = mysql_connect("xxx","xxxx_user","xxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jjlliinn_test", $con);
$date = $_POST['date'];
$propertydescription = $_POST['propertydescription'];
$transactiontype = $_POST['transactiontype'];
$applicabledocument = "null";
$received = $_POST['received'];
$paid = $_POST['paid'];
$sql = mysql_query("INSERT INTO `transactions` (`date`, `agentclient`, `propertydescription`, `transactiontype`, `applicabledocument`, `received`, `paid`)
VALUES
('$date', '$agentclient', '$propertydescription', '$transactiontype', '$applicabledocument', '$received', '$paid')") or die(mysql_error());
$query = mysql_query($sql);
mysql_close($con);
?>