thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Can't login into admin #241

Open saweetha opened 6 years ago

saweetha commented 6 years ago

https://www.youtube.com/watch?v=ldPPttGFJYk&list=PLAkMqlQoeMeiwvNWpe3mhgQxAa1jiGwmt&index=27 I did everything in this video, but the admin and password which appear in the video never appear in my website. I cant login into my admin. Where is the thing went wrong ? Any ideas ?

saweetha commented 6 years ago

<?php

Start Session;

session_start();

Database Connection:

include('../config/connection.php');

if($_POST) {

$q = "SELECT * FROM users WHERE email = '$_POST[email]' AND password = SHA1('$_POST[password]')";
$r = mysqli_query($dbc, $q);

if(mysqli_num_rows($r) ==1) {

    $_SESSION['username'] = $_POST['email'];
    header('Location: index.php');

}

}

?>

<!DOCTYPE html>

Admin Login
Login
'; echo $_POST['password']; } ?>

this is my login code

saweetha commented 6 years ago

<?php

Start the session:

session_start();

if(!isset($_SESSION['username'])) { header('Location: login.php'); }

?>

<?php include('config/setup.php'); ?>

<!DOCTYPE html>

<?php echo $page['title'].'| '.$site_title; ?>

Admin Dashboard

            
        

my index code

creptor commented 6 years ago

I'm sorry I'm busy at the moment, please wait until Monday for further help. I'll try to fix it.

creptor commented 6 years ago

It should work just fine, if you continue to have problems please check the spelling inside the inputs.

Also, an easy way to call to the same page on a form post is to use ´<form action="" ...>´