-2

I am currently developing a login form which the user will login from to access dashboard.php. The problem is that when I add the key to the table in phpmyadmin and then try to login, nothing happens. Same with when I enter it wrong.

My code is as follows:

config.php

<?php
    define('DB_SERVER', 'localhost');
    define('DB_USERNAME', 'zxcr_sprxadmin');
    define('DB_PASSWORD', 'Z@nico9TJK');
    define('DB_DATABASE', 'zxcr_mhqsprx');
    $db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
?>

dashboard.php

<?php
    include('session.php');
?>

MySQL table: www.prntscr.com/aejxpy

Login Form: www.prntscr.com/aejxvg

login.php: www.prntscr.com/aejyjb

session.php: www.prntscr.com/aejywn

I just have no clue what it could be, any help is much appreciated.

Panda
  • 6,955
  • 6
  • 40
  • 55
Zac Ram
  • 21
  • 1

2 Answers2

0

The reason I do not think it is working is because When you are doing headers it must me a capital l like so: header('Location: stackoverflow.com');

Mental NOTE: And You should not be setting the users key in there

The Beast
  • 1
  • 1
  • 2
  • 24
  • @Iuweiqi I was told it does – The Beast Mar 13 '16 at 02:35
  • *Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.* ~ http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 – Panda Mar 13 '16 at 02:35
0

You'll need exit; after header() to terminate the execution, else your code will continue executing:

header('location: stackoverflow.com');
exit;
Panda
  • 6,955
  • 6
  • 40
  • 55