<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
deal_register.php<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8" ><?phpinclude ("connect_mysql.php"); $ Sql= "INSERT into users (username, real name, password, gender, contact phone, QQ number, Email, profile, home address) VALUES ('". $_post[' username '). "', '". $_post[' Realname ', ' ". $_post[' pwd ']." ', ' ". $_post[' sex ']." ', ' ". $_post[' Tel ']." ', ' ". $_post[' QQ ']." ', ' ". $_post[' Email ' ]. "', '". $_post[' homepage ']. "', '". $_post[' addr ']. "')"; $res =mysql_query ($sql), if (!empty ($res)) {echo "<script>alert (' Registration succeeded! '); window.location= ' index.html ';</script> ";} Else{echo "<script>alert (' Registration failed! "Window.location= ' index.html ';</script>";}? >
checkuser.php<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8" ><?phpinclude "connect_mysql.php"; $name =$_get[' param1 '; $res =mysql_query ("SELECT * from users where user name = ' $name '"), $re =mysql_fetch_array ($res); if (!empty ($ RE) {echo "<font color= ' Red ' > Username $name already exist! </font> ";} Else{echo "<font color= ' green ' > Username $name passed detection! </font> ";}? >
connect_mysql.php<?php $con =mysql_connect ("localhost", "root", "08246298") mysql_select_db ("Test", $con); >
PHP User Registration Basic processing