PHP registration code
<? 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 ('registration successful! '); History. back; </script> ");
}
Else
{Echo ("the user name cannot be blank! ");
}
}
Else
{Echo ("data source connection failed! ");}
?>
<Form name = "form1" action = "" method = "post">
<Input type = "text" name = "Uname"/>
<Br/>
<Input type = "password" name = "Pwd"/>
<Br/>
<Input type = "submit" value = "Register"/>
<Input type = "hidden" value = "register" name = "register"/>
</Form>
Excerpt from 2012317256