[MDEV-21890] cannot connect to phpAdmin Created: 2020-03-07  Updated: 2020-06-28  Resolved: 2020-06-28

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.5.1
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: benson gathua Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

visual studio code


Issue Links:
Blocks
blocks MDEV-21863 InnoDB: Assertion failure rem0rec.cc... Closed

 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";
}
}*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
?>



 Comments   
Comment by Elena Stepanova [ 2020-05-27 ]

What error are you getting?

Generated at Thu Feb 08 09:10:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.