Я написал код для страницы регистрации все в порядке но мои представленные данные не хранятся в базе данных?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document <font color="white" face="Showcard Gothic"> <div id="formpag23"> <table width="510" border="1" align="center"><tbody><tr> <td colspan="2" align="center">Sign up</td> </tr> <tr> <td>Name:</td> <td></td> </tr> <tr> <td>Email-id:</td> <td></td> </tr> <tr> <td>Address:</td> <td></td> </tr> <tr> <td>Contact Number:</td> <td></td> </tr><tr> <td>Password</td> <td></td> </tr> <tr> <td>Re-enter Password</td> <td></td> </tr><tr><td colspan="2" align="center"></td> input[type="submit"]{ /* change these properties to whatever you want */ background-color: #555; color: #fff; border-radius: 10px; } </tr> </tbody></table> </div> <?php include("connect1.php"); $id=1; $res2=mysqli_query($con,"select customer_id from sign_up"); while($row1=mysqli_fetch_array($res2)) { $id++; } mysqli_query($con,"INSERT INTO `ourpjct1`.`sign_up`(`customer_id`)VALUES('$id')"); if(isset($_POST['button1'])) { //mysqli_query($this->$con, $query) or die(mysqli_error($this->$con)); //echo "hi sign button is working"; //echo "hii"; //$_POST['number']=""; //$id=$_POST['id']; $name=$_POST['name']; $password=$_POST['password']; $password1=$_POST['password1']; $number=$_POST['number']; $address=$_POST['address']; //$number=$_POST['number']; $email=$_POST['email']; if($password==$password1) { echo "hi sign button is working"; mysqli_query($con,"INSERT INTO `ourpjct1`.`sign_up`('customer_name',`customer_id`,'customer_number',`customer_address`,`customer_password`,`customer_email`)VALUES('$name','$id','$address','$number','$password','$email')"); mysqli_query($con,"UPDATE `sign_up` SET `customer_name`='$name',`customer_address`='$address',`customer_number`='$number',`customer_password`='$password',`customer_email`='$email' WHERE `customer_id`='$id'"); echo ""; echo ""; echo ""; echo "<table><tbody><tr><td> </td><td>"; // $_POST['number']=""; // document.getElementsByName(name)="disabled"; // //echo ""; } } ?> input[type="submit"]{ change these properties to whatever you want */ background-color: #555; color: #fff; border-radius: 10px; }
Что я уже пробовал:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document <font color="white" face="Showcard Gothic"> <div id="formpag23"> <table width="510" border="1" align="center"><tbody><tr> <td colspan="2" align="center">Sign up</td> </tr> <tr> <td>Name:</td> <td></td> </tr> <tr> <td>Email-id:</td> <td></td> </tr> <tr> <td>Address:</td> <td></td> </tr> <tr> <td>Contact Number:</td> <td></td> </tr><tr> <td>Password</td> <td></td> </tr> <tr> <td>Re-enter Password</td> <td></td> </tr><tr><td colspan="2" align="center"></td> input[type="submit"]{ /* change these properties to whatever you want */ background-color: #555; color: #fff; border-radius: 10px; } </tr> </tbody></table> </div> <?php include("connect1.php"); $id=1; $res2=mysqli_query($con,"select customer_id from sign_up"); while($row1=mysqli_fetch_array($res2)) { $id++; } mysqli_query($con,"INSERT INTO `ourpjct1`.`sign_up`(`customer_id`)VALUES('$id')"); if(isset($_POST['button1'])) { //mysqli_query($this->$con, $query) or die(mysqli_error($this->$con)); //echo "hi sign button is working"; //echo "hii"; //$_POST['number']=""; //$id=$_POST['id']; $name=$_POST['name']; $password=$_POST['password']; $password1=$_POST['password1']; $number=$_POST['number']; $address=$_POST['address']; //$number=$_POST['number']; $email=$_POST['email']; if($password==$password1) { echo "hi sign button is working"; mysqli_query($con,"INSERT INTO `ourpjct1`.`sign_up`('customer_name',`customer_id`,'customer_number',`customer_address`,`customer_password`,`customer_email`)VALUES('$name','$id','$address','$number','$password','$email')"); mysqli_query($con,"UPDATE `sign_up` SET `customer_name`='$name',`customer_address`='$address',`customer_number`='$number',`customer_password`='$password',`customer_email`='$email' WHERE `customer_id`='$id'"); echo ""; echo ""; echo ""; echo "<table><tbody><tr><td> </td><td>"; // $_POST['number']=""; // document.getElementsByName(name)="disabled"; // //echo ""; } } ?> input[type="submit"]{ change these properties to whatever you want */ background-color: #555; color: #fff; border-radius: 10px; } </td></tr></tbody></table></font></td></tr></tbody></table></font>