Click here to Skip to main content
15,898,134 members

Comments by Member 13761917 (Top 1 by date)

Member 13761917 4-Apr-18 7:02am View    
thanks this has worked for me though i cannot login to my page as an admin

the page just freshes itself, no errors

This is my login.php file

<?php
$host="localhost";
$uname="root";
$pas="";
$db_name="cman";
$tbl_name="members";

$link = mysqli_connect($host, $uname, $pas, $db_name) or die ("cannot connect");
$select_db_result = mysqli_select_db($link, $db_name);
?>
<?php
if (isset($_POST['login'])){

$username=$_POST['username'];
$password=$_POST['password'];

$login_query=mysqli_query("select * from members where mobile='$username' and password='$password'");
$count=mysqli_num_rows($login_query);
$row=mysqli_fetch_array($login_query);


if ($count > 0){
session_start();
$_SESSION['id']=$row['id'];
header('location:members/dashboard.php');

}else{
header('location:index.php');
}
}
?>

what do u think could be the problem?