This is
NOT safe to use. There are still several ways to do a SQL exploit even in the register (register.php).
PHP Code:
$name = $_POST['bean_avatarName'];
Unfiltered post. You can inject anything here and extract anything you wish from the users table as no illegal characters are escaped.
Fix (VERY simple stuff):
PHP Code:
$name = filter($_POST['bean_avatarName']);
Same problem here, but I've seen you've tried to escape illegal characters using htmlspecialchars() which only escapes
HTML characters. htmlspecialchars() will
NOT stop a sql injection or escape things like ',x00 ect..
PHP Code:
$name = htmlspecialchars($_POST['bean_avatarName']);
$password = htmlspecialchars($_POST['bean_password']);
$password2 = htmlspecialchars($_POST['bean_retypedPassword']);
$email = htmlspecialchars($_POST['bean_email']);
$dob_day = htmlspecialchars($_POST['bean_day']);
$dob_month = htmlspecialchars($_POST['bean_month']);
$dob_year = htmlspecialchars($_POST['bean_year']);
There's no use in trying to escape html characters. So we'll escape illegal MySQL characters instead:
PHP Code:
$name = filter($_POST['bean_avatarName']);
$password = filter($_POST['bean_password']);
$password2 = filter($_POST['bean_retypedPassword']);
$email = filter($_POST['bean_email']);
$dob_day = filter($_POST['bean_day']);
$dob_month = filter($_POST['bean_month']);
$dob_year = filter($_POST['bean_year']);
So this should work now, and the register page should be secure, as we've escaped any possible bad characters. A proper and real solution would be preparing a query in MySQLi and seeing the POST values as strings. But only a few people will know what I'm on about..
Anywho, I wouldn't advise using the CMS as it looks like the OP doesn't know much about MySQL injections.