Heim >Backend-Entwicklung >PHP-Tutorial >PHP注册代码_PHP教程
PHP 注册代码
$Uname=$_POST["Uname"];
$Pwd=$_POST["Pwd"];
$register=$_POST["register"];
$link=mysql_connect("localhost","root","12345");
if($link)
{
$db_selected=mysql_query("use register", $link);
if ( $register="register")
{
if ( $Uname !="" )
{
$result=mysql_query("insert into [user] (Uname , Pwd) values($Uname, $Pwd)" , $link);
echo ("<script>alert('注册成功 !');history.back; </script>");
}
else
{ echo("用户名不能为空!");
}
}
else
{ echo("数据源连接失败!"); }
?>
摘自 2012317256