BR
asked on
html input clean up
I use below function to clean up my web users html inputs,
most of the time I insert my html inputs to mysql database.
do you think this function is enough?
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$id = test_input($_POST["id"]);
$comment = test_input($_POST["comment "]);
$adet = test_input($_POST["adet"]) ;
most of the time I insert my html inputs to mysql database.
do you think this function is enough?
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$id = test_input($_POST["id"]);
$comment = test_input($_POST["comment
$adet = test_input($_POST["adet"])
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much Ray Paseur
the most effective way is to store your data into your database, and then retrieve and display it into your web pages.
you need to test the scenarios for both insertion and updating.
your function generally looks ok...