Posts

Showing posts from June, 2021

Session With Login

<?php require_once( 'db.php' ); global $conn,$db; // If form submitted, insert values into the database. //1st step data get with method.... if (isset($_POST[ 'login_submit' ])){ $email = $_POST[ 'email' ]; $password = $_POST[ 'password' ]; //2nd step query insert and check the connection..... $sql_query = " SELECT * FROM `register` WHERE email = '$email' " ; $query = mysqli_query($conn,$sql_query) or die ( 'Please check mysqli:' .$sql_query); //3step result check in num rows with condition.... $result = mysqli_num_rows($query); if ($result > 0 ){ $rows=mysqli_fetch_array($query); $db_password=$rows[ 'password' ]; if (md5($password) == $db_password){ $_SESSION[ 'login_name' ] = $email; header( "Location: fetch_data.php" ); } else { $_SESSION[ 'msg' ] = 'password not match.' ;

task ajax

 1. json_encode 2. __dir__ 3.

Image upload in CI with Ajax

Controlar==> public function Register(){ $data[ 'main_content' ] = 'ajax' ; $this ->load->view( 'partials/header' ,$data); $this ->load->view( 'ajax' , $data); $this ->load->view( 'partials/footer' ,$data); } public function register_post(){ $target_dir =dirname(dirname( __dir__ )) . "/uploads/" ; $target_file = $target_dir . basename($_FILES[ "image" ][ "name" ]); $filetmp_name = $_FILES[ "image" ][ "tmp_name" ]; if (move_uploaded_file($filetmp_name, $target_file)) { $set=array( 'data' => 'uploooo' , 'status' => '1' , ); echo json_encode($set); } else { $set=array( 'data' => 'image is not uploded' , 'status' => '0' , ); echo jso

What is Helper And Liabrary In C.I

  What is Helper And Liabrary=> 1.Helper=>Helper mai hum wahi functaion cll krate hai jise hum kahi v data nikal sakte hai 2.Liabrary=>liabrary mai hum jo function lete hai uske lie class ki jrurt hoti hai data get krane k lie class dena pdta hai