Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once'connection.php';
- if (isset($_POST['submit'])) {
- $sql1="SELECT * from signup";
- $result=mysqli_query($conn, $sql1);
- while($row=mysqli_fetch_assoc($result))
- { if($row>0)
- {
- $table_phno=$row['phno'];
- $table_email=$row['email']; } # code...
- }
- if ($result) {
- ;
- $username=$_POST['username'];
- $password=$_POST['password'];
- $email=$_POST['email'];
- $phno=$_POST['phno'];
- $ntdaddress=$_POST['ntdaddress'];
- $cpassword=$_POST['cpassword'];
- $password=$_POST['password'];
- $phno=$_POST['phno'];
- if ($phno==$table_phno) {
- echo '<script>alert("this phone number using by someone else");</script>';
- exit();
- }
- if($email==$table_email){
- echo '<script>alert("email are using by someone else");</script>';
- exit();
- }
- if ($cpassword !== $password) {
- echo '<script>alert("Password does not match!");</script>';// at this line
- exit();
- }
- $sql = "INSERT INTO signup (username, email, phno, password, ntdaddress ) VALUES('$username','$email', '$phno', '$password','$ntdaddress')";
- $result1=mysqli_query($conn, $sql);
- if ($result1) {
- '<script>$( "#signin" ).load( "index.php" );</script>';
- $sql2= "select * from signup where username='$username'";
- $value2=mysqli_query($conn, $sql2);
- while($row=mysqli_fetch_assoc($value2)){
- $userid=$row['userid'];
- echo $userid;
- }
- $sql3="INSERT into food(userid)VALUES('$userid')";
- $value3=mysqli_query($conn, $sql3);
- $_SESSION['phno']=$_POST['phno'];
- $_SESSION['ntdaddress']=$_POST['ntdaddress'];
- $_SESSION['email']=$_POST['email'];
- } else {
- echo "error";
- }
- mysqli_close($conn);
- }
- }
- ?>
Add Comment
Please, Sign In to add comment