Can any one help me i want to add confirm password option where there should be a clause that checks that both password n confirm password is same, email option and also there should be check for duplicate name check for this registration page.
<?php
if ( isset ( $_POST [ 'register' ] ) ) {
$account = ! empty ( $_POST [ 'account' ] ) ? $_POST [ 'account' ] : null ;
$password = ! empty ( $_POST [ 'password' ] ) ? $_POST [ 'password' ] : null ;
if ( ! is_null ( $account ) && ! is_null ( $password ) ) {
$db = GetDatabaseConnection ( 'db_account' ) ;
$sql = $db->prepare ( 'INSERT INTO `t_account` ( `name` , `pwd` , `pw2` , `gd` ) VALUES ( :account , :passwd , :pw2 , :tps )' ) ;
$pw2 = ( constant ( 'StoreTextPWD' ) ? $password : 'NULL' ) ;
$sql->bindParam ( ':account' , $account , PDO::PARAM_STR ) ;
$sql->bindParam ( ':passwd' , md5 ( $password ) , PDO::PARAM_STR ) ;
$sql->bindParam ( ':tps' , constant ( 'StartTPoints' ) , PDO::PARAM_INT ) ;
$sql->bindParam ( ':pw2' , $pw2 , PDO::PARAM_STR | PDO::PARAM_NULL ) ;
if ( $sql->execute ( ) ) {
echo 'Ok ...' ;
} else echo 'Error ...' ;
} else {
echo 'Account and Password must be filled' ;
}
}
?>