Why cannot I use this code for registration? & Lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; XHTML & nbsp; 1.0 & nbsp; TransitionalEN & nbsp; www. w3.orgTRxhtml1DTDxhtml1-transitional. dtd & gt; Why cannot I use this code for registration?
Untitled Document
$ Conn = mysql_connect ('localhost', 'root', '') or die ('database connection error ');
Mysql_select_db ('demo', $ conn );
Mysql_query ("set names 'gbk '");
// Check whether the member name exists
If ($ _ post [username]) {
$ SQL = "select * from users where username = '$ _ post [username]'";
$ Res = mysql_query ($ SQL) or die ("query failed! ");
$ Us = $ _ get [name];
Echo $ us. "222222 ";
$ Pstutorial = md5 ($ _ post [password]);
$ Sex = $ _ post ['Sex '];
$ Age = $ _ post ['age'];
$ Qq =$ _ post ['QQ'];
$ Phone = $ _ post ['phone'];
$ Email = $ _ post ['email '];
$ Address = $ _ post ['address'];
If (is_array (mysql_fetch_row ($ res ))){
Echo "this member name already exists! ";
} Else {
$ SQL = "insert into users (username, password, sex, age, qq, phone, email, address) values ('$ use',' $ ps ', $ sex, $ age, $ qq, '$ phone', '$ email', '$ address ')";
Echo $ SQL;
Mysql_query ($ SQL) or die ("registration failed ");
Echo "script" alert ('registered successfully'); location. href = 'login. php' script ";
}
}
?>