我正在制作一个小型用户注册系统,以尝试自学更多 PHP 和 MySQL。到目前为止,我已经到了这一点:
<?php
$errormsg ="";
if (isset($_POST['adduser'])){
$email = $_POST['email'];
$pword = $_POST['pword'];
$pword2 = $_POST['pword2'];
$email = stripslashes($email);
$email = strip_tags($email);
$pword = stripslashes($pword);
$pword = strip_tags($pword);
$pword2 = stripslashes($pword2);
$pword2 = strip_tags($pword2);
if ($email == "") {
$errormsg ="Error, You must fill in the email box.";
}
else if ($pword == "") {
$errormsg ="Error, You must fill in the password box.";
}
else if ($pword2 == "") {
$errormsg ="Error, You must fill in the repeat password box.";
}
else if ($pword != $pword2) {
$errormsg ="Error, Your passwords don't match!";
}
else {
$errormsg = "Success!";
}
}
?>
这个回显目前已经成功,我计划在完成后将数据添加到数据库中。
如何检查电子邮件是否有效?(例如是“example@example.com”而不仅仅是“rgaegegegege”)
使用带斜杠和标签的安全性如何?我还能做些什么来降低它的破解能力?
谢谢你的帮助!