PHP ??? ?? ?? ?? ???? ? ??
?????? ?? ?? ? ??????? ?? PHP? ???? ??? ??? ???????.
?? ????? ????? ?? ???? ?? ???? ????? ???? ? ? ????.
<?php header("content-type:text/html;charset=utf-8"); //連接數(shù)據(jù)庫 $link = mysqli_connect("localhost","root","root","regedit"); if (!$link) { die("連接失敗: " . mysqli_connect_error()); } $username=$_POST['username']; $password=$_POST['password']; $pwd_again=$_POST['pwd_again']; if($username == "" || $password == "" || $pwd_again == "") { echo "請確認信息完整性"; }else{ if($password!=$pwd_again) { echo"兩次輸入的密碼不一致,請重新輸入!"."<br/><br/>"; echo"<a href='regedit.html'>重新輸入</a>"; } else { $sql="insert into form(username,password) values('$username','$password')"; $result=mysqli_query($link,$sql); if(!$result) // 判斷數(shù)據(jù)是否成功插入進數(shù)據(jù)庫 { echo"注冊不成功!"."<br/><br/>"; echo"<a href='regedit.html'>返回</a>"; } else { echo"注冊成功!"."<br/><br/>"; echo"<a href='login.html'>立刻登錄</a>"; } } } ?>
?? ???? ??????? ???? ?? ??? ??? ?????. ?? ???????
?? ? ??? ???? ???? ? ????? ????, ?? ??? ???? ??? ?????. ?????? ??? ??? ?????.
????? ?????? ?? ?? ???? ?? ??? ??????? ???? ??? ????? ?????. ??? ???? ??? ????, ??? ??? ?????.