- Information
- AI Chat
Admin Master Authentication
Bachelor of Computer Applications (BCA2020)
Mahatma Gandhi University
Recommended for you
Preview text
We can start our project with the following steps.
- Create a new project folder in to the directory Folder name as your own project title. Eg: Puddle net , gift cart etc....
For wamp users
For xamp users
Create two folders inside the project folder.
Then open Visual studio code and click
Open project folder to vs code.
- Then our project will open to vs code. After maximise Guest folder and create a new file as
Note : The rouded option can use to create a new file in to Guest folder
After we can include our external files and to the page login for our login page css and javascript proper working.
Then start wamp server or xamp server and open chrome or any other browser.
In chrome , type for run our project
So we can see our project folder , and we created project subfolders. Then click - can see our output.
Our Output of login page
- Then include to login code.
Then Create a new file in the project folder not in the Guest folder and named as
Note : The file will create outside the folders admin and Guest
Then given code to the dboperation for connect database to our project.
Note : You can give your database name placed to the field of mentioned databasename.
<?php class dboperation { public $con,$res;
function __construct() { $this->con=mysqli_connect("localhost","root","","databasename"); // Check connection if (!$this->con) { die("Connection failed: ". mysqli_connect_error()); }
} public function query($sql) { //$this->connect(); $this->res=mysqli_query($this->con,$sql); return $this->res; }
}
?>
Then open your project created database and open
After open click insert tab to insert values to database.
Then open loginaction and declare two variables for store input values from we given for login to the login action.
Then create include our file page to our page for checking databse connectivity and create an for dboperation.
Then write the queries for checking the login activity of is valid or invalid.
$sql="select * from tbllogin where username='$username' and password='$password'"; $res=$obj->query($sql);
if(mysqli_num_rows($res)== 1 ) { $row=mysqli_fetch_array($res); if($row["role"]=="Admin" && $row["role"]=="Confirm" ) { header("location:..\Admin\index"); } else {
echo "<script>alert('Invalid Username/Password!!'); window='login'</script>";; } }
Full code of page.
- Open maximize admin folder and create a new file named as and give an tag and a title
Admin Master Authentication
Course: Bachelor of Computer Applications (BCA2020)
University: Mahatma Gandhi University
- Discover more from: