Admin part 2

do this work

  1. show data in html table
  2. downlode this service.php file download
  3. show data in update form
  4. make update
  5. down load login foler
  6. add this in admin folder
  7. open index.php
  8. add this code
 include "../database.php";
 session_start();

if (isset($_POST['login'])) {
	$name = $_POST['name'];
	$email = $_POST['email'];
	

    $query = "SELECT * FROM student  where name='$name' and 
                  email='$email'";
    $result = mysqli_query($connection,$query);

    if (mysqli_num_rows($result)) {
    	$_SESSION['user']=$name;
    	header("location:/data_practice/bootstrap_curd/crud.php");
    }else{
    	
    }

}

go to admin/crud.php

add this code at top

<?php
	session_start();

	if (isset($_SESSION['user'])) {
		
	}else{
		header('location:login/index.php');
	}
?>

make a file logout.php

add this ode

<?php

		session_start();
		session_destroy();
	

        header("location:crud.php");


?>

Leave a comment