Little Brother Beginner php ..... Ask the form for submission questions
$connec =mysql_connect ("localhost", "root", "Vertrigo") or Die ("Cannot connect to database server:". mysql_error ());
mysql_select_db ("Data", $connec) or Die ("Cannot select Database:". mysql_error ());
mysql_query ("Set names ' UTF8 '");
?>
if ($_post["id"] and $_post["action"]== "Del")
{
$sql = "Delete from class where Id=$_post[id]";
mysql_query ($sql, $connec);
Echo ("");
}
?>
There is always a mistake ....
How can I tell you how to determine the action of form submission?
What's more, it's not safe to do so. What can I do to be safe? Thank you.
------Solution--------------------
$_post[id] to $_get[id [change]
------Solution--------------------
What's wrong with the report?
Determining the type of user, whether logged in, is the easiest security check.
------Solution--------------------
The > Delete
The most common form submission is the submission Like, hyperlinks are submitted with get.
Remove and then use $_get to receive.
------Solution--------------------
To determine the basic parameters of the parameter, whether it is a numeric value, to determine whether the transmission is empty.
Generally there is no problem.