Hi all im experimenting and started creating a website that is going to implement a forum. I have starting looking at security issues that may effect the website. Area's such as cross site scripting and sql injection attacks.
From research stripping all html tags will prevent the XSS. Will this along with stripping the SQL special characters going to be enough to prevent the sql injection attacks?
<?php
require "dbconn.php";
$mnam = strip_tags($_GET['blogentername']);
$mcom = strip_tags($_GET['blogmessage']);
$approve = 'N';
$dte = gmdate("d-M-Y H:i:s");
$mnam = mysql_real_escape_string($user);
$mcom = mysql_real_escape_string($mcom);
$query = "INSERT INTO blogentry VALUES ('".$mnam."','".$dte."','".$mcom."','".$approve."','','')";
$results = mysql_query($query)
or die(mysql_error());
header('Location:messages.php?messagesent=1');
?>
Thanks all for you time Andy