Opt In (Do Not Edit Here)

Oct 30, 2016

Login Page Code in PHP

<?php
define('HOST','host_name');
  define('USER','user_name');
  define('PASS','password');
  define('DB','database_name');
  $con = mysqli_connect(HOST,USER,PASS,DB);

    $username= $_GET['username'];
   
    //Creating sql query with where clause to get an specific employee
    $sql = "SELECT * FROM login WHERE username='$username'";
   
    //getting result
    $r = mysqli_query($con,$sql);
   
    //pushing result to an array
    $result = array();
    $row = mysqli_fetch_array($r);
    array_push($result,array(
            "username"=>$row['username'],
            "password"=>$row['password']
        ));

    //displaying in json format
    echo json_encode(array('result'=>$result));
   
    mysqli_close($con);
?>

About The Author :

Freelancer and IT Engineer
Softwares Developed by Mayur Dighe ImmortalDotNet.WordPress.com

0 comments :

All Rights Reserved. 2014 Copyright SIMPLITONA

Powered By Blogger | Published By Gooyaabi Templates Designed By : BloggerMotion

Top