I want to input a message box, "ID ALREADY REGISTERED".
Please help.
- <?
- include("cn.php");
- $message= NULL;
- $ID = $_POST['ID'];
- $Fname = $_POST['Fname'];
- $Mname = $_POST['Mname'];
- $Lname = $_POST['Lname'];
- $Address = $_POST['Address'];
- $Gender = $_POST['Gender'];
- if ($Gender == 0) {
- $Gender2 = "Male";
- }else{
- $Gender2 = "Female";
- }
- $Username = $_POST['Username'];
- $Type = $_POST['Type'];
- $type1="Student";
- if ($Type == $type1) {
- $Pending = "0";
- }
- $ASQL1 = "SELECT * FROM tbl_account WHERE Username='".$Username."' ";
- if ($ANum1 == 1) {
- } else {
- $ASQL = "SELECT * FROM tbl_account WHERE ID='".$ID."' ";
- if ($ANum == 1) {
- } else {
- if (($ID != "") AND ($Fname != "") AND ($Mname != "") AND ($Lname != "") AND ($Address != "") AND ($Gender != "") AND ($Username != "") AND ($Password1 != "") AND ($Password2 != "")) {
- if ($Password1 != $Password2) {
- } else {
- $SQL = "INSERT into tbl_account (ID, Username, Password, Type, Pending) VALUES ('$ID', '$Username', '$Password1', '$Type', '$Pending')";
- $SQL2 = "INSERT into tbl_profile (ID, Fname, Mname, Lname, Address, Gender,Type) VALUES ('$ID', '$Fname', '$Mname', '$Lname', '$Address', '$Gender2','$Type')";
- $SQL3 = "INSERT into tbl_confirm (ID, Fname, Lname,Type) VALUES ('$ID', '$Fname', '$Lname', '$Type')";
- }
- } else {
- }
- }
- }
- ?>
- here is my code,
- $ASQL = "SELECT * FROM tbl_account WHERE ID='".$ID."' ";
- $ARS = mysql_query($ASQL);
- $ANum = mysql_num_rows($ARS);
- if ($ANum == 1) {
- header("location: register3.php?Err=5");
- } else {
- Add new comment
- 58 views