I have make a panel..i want that if i select "select keyword" option..then no data will be insert into table..i have set a message that "select the keyword"..when anyone try to insert this "select keyword" into table ...but also data already inserted into db...what i will do..below is my panel screenshot.
i have used below code for alert message...but i want to stop to insert the value also...
// Get values from form
$keyword=$_POST['mytextarea'];
$message=$_POST['message'];
if ($_POST['mytextarea'] == "Select Keyword")
{
echo "<script>
alert('Please Select the keyword');
window.location.href='home.php';
</script>";
}
// Insert data into mysql
$sql="INSERT INTO tbl_report(recevtime,keyword, message) VALUES( now(), '$keyword', '$message')";
$result=mysql_query($sql);