Home >Backend Development >PHP Tutorial >PHP registration code

PHP registration code

巴扎黑
巴扎黑Original
2016-11-24 09:33:151234browse

$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("数据源连接失败!"); }

?>




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:MYSQLI operation classNext article:MYSQLI operation class