Hi Everyone.
I've got a bit of a query, if anyone can help. I run a gaming community site, which uses Invision Power Board 3.1.2. I've been working on a "Quotes" Database, which has a PHP Front end, which adds data to a SQL Database. I have an Insert.php, which submits the data to the SQL, which works fine, however I have no idea how to secure the "inserting of quotes" so that it doesn't get spammed constantly.
So I was wondering whether it would be easier to add a delay in between sumbissions based on the IP Address, or whether to lock it down with IPB (i have no idea how).. So if anyone could give me a hand with this, it would be greatly appreciated.
Below is the code to my insert.php page. A HTML page $_POST's to this.
<?php
$con = mysql_connect("localhost","quotesuser","xxxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$date = date("Y/m/d - H:i:s");
mysql_select_db("quotes", $con);
$qd = mysql_real_escape_string($_POST['Quote_Data']);
$qb = mysql_real_escape_string($_POST['Quoted_By']);
$sql="INSERT INTO Quotes (Quote_Data, Quoted_By , Date_Time) VALUES ('$qd','$qb','$date')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
header("Location: select.php");
echo "Quote Added to Database.";
mysql_close($con)
?>