Firstly, connecting to database hosting which is initilized in config.php
require_once ('../../library/config.php');then making function for string variable.
mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement.
addslashes — Quote string with slashes.
strip_tags — Strip HTML and PHP tags from a string.
function protect ($string)Next, process the form when user click on submit button
{
$string = mysql_real_escape_string ($string);
$string = strip_tags ($string);
$string = addslashes ($string);
return $string;
}
Checking data when processing the form
I repeat a register form which will appear the same time with all errors
If there is errror messages when validating all input data, then INSERT input data into hosting database.
When I am testing the register page, I archived some result:
No comments:
Post a Comment