Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21890

cannot connect to phpAdmin

    XMLWordPrintable

Details

    Description

      <?php
       
       
      //connect to database
       
       
       $db =mysqli_connect('localhost','connect','3xzF&?ve&jiV&+','bliss') or die("could not connect to database");
       
       
      	if(mysqli_connect_errno())
      	{
      		echo"Error!!!".mysqli_connect_errno();
      	}
       
      session_start();
       
      //initialise variables
      $username="";
      $email="";
      $errors=array();
      //register users
       
      $username =mysqli_real_escape_string($db,$_POST['username']);
      $email =mysqli_real_escape_string($db,$_POST['email']);
      $password_1 =mysqli_real_escape_string($db,$_POST['password_1']);
      $password_2=mysqli_real_escape_string($db,$_POST['password_2']);
       
      // validating form inputs
       
                  if(empty($username)){array_push($errors,"username is required");};
                  if(empty($password_1)){array_push($errors,"password is required");};
                  if(empty($email)){array_push($errors,"email is required");};
                  if( $password_1!=$password_2){ array_push ($errors,"password should match");};
       
       
      //check db with existing same username and email
      $user_check_query="select * FROM manager_login WHERE username=$username or email=$email LIMIT 1";
      $result= mysqli_query($db,$user_check_query);
      $user= mysqli_fetch_assoc($result);
       
      if($user){
       if($user['username']==$username){array_push($errors,"username already exists");};
       if($user['email']==$email){array_push($errors,"This email is already has a registered username");};
      //register the user if no error
      if (count($errors)==0){
       
          $password=md5($password_1);//this will encrypt the password
          $query="INSERT INTO manager_login (username,email,password) VALUES ('$username','$email','password')";
          mysqli_query($db,$query);
          $_SESSION['username']=$username;
          $_SESSION['success']="You are now logged in";
          header( 'location: manager.php' );
      }
       
       
      }
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      /*$count= mysqli_num_rows($result);
      if($count==1){
       
          echo "username/email already exist!please use provide unique details";
      }else{
      $user_check_query="insert  into manager_login(username,email,password_1,password_2)values($username,$email,$password_1,$password_2)";
      $result= mysqli_query($db,$user_check_query);
      if($result){
          echo "registered successfully";
      }
      }*/
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      ?>
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bliss benson gathua
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.