// connectingtothe database include "dbconn.php"; session_start(); //$link = mysql_connect('localhost', 'root', '') or die('Could not connect: ' . mysql_error()); //mysql_select_db('alumni') or die('Could not select database'); if(isset($_POST['Submit2'])){ $strSQLCheckUser = "SELECT * FROM `registration` WHERE `username` = '$_POST[txtUsername3]' OR `email` = '$_POST[txtEMail]'"; $strRESCheckUser = mysql_query($strSQLCheckUser) or die($message = "can't execute the query check user1"); $intNoOfRec = mysql_num_rows($strRESCheckUser); if($intNoOfRec == 0) { $mypassword = md5($_POST['txtPassword4']); $strSQLAddRec = "INSERT INTO `registration` (`user_id`, `title`, `fullname`, `username`, `password`, `email`, `phonenumber`, `workplace`) VALUES ('', '$_POST[title]', '$_POST[txtFname]', '$_POST[txtUsername3]', '$mypassword', '$_POST[txtEMail]', '$_POST[txtPhone]', '$_POST[txtWork]')"; $strRESAddRec = mysql_query($strSQLAddRec) or die($message = "can't execute the query Add user2"); $strMessage = "YES"; $strMessages = "YES"; //$x->register($_POST[txtEMail], $_POST[txtPassword], $_POST[txtEMail], $useractive = 1); } else { $Error = "Username or Email address is alredy used"; $strMessage = "YES"; } } ?>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||