thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

I can't login to my page manager. #249

Closed Chriswilldo closed 6 years ago

Chriswilldo commented 6 years ago

It's been a good 6 months since I've worked on this. Long story short, I can't get past my login.php . I admit I am skimming though the videos to troubleshoot but it's so stressful right now that I don't know where to begin. To my recollection I'm at least half way into the series, finding out exactly where has been hell. Besides that point I can't login! I forgot how to change passwords. I tried on phpmyadmin but it doesn't no matter how I try. Please help me!!!! I can seem to get to the admin homepage but if I try putting that ? in before page to enter the dashboard it sends me straight to login. >: `\

These are all in the admin folder*

Login.php

`<?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

` views/pages.php `

Admin Dashboard

` Template/header.php ` setup.php ` ` <?php echo $page['title'].' | '.$site_title; ?>
` queries.php ` Page was '.$action.'!

'; } else { $message = '

Page could not be '.$action.' because: '.mysqli_error($dbc); $message .= '

Query: '.$q.'

'; } } if(isset($_GET['id'])) { $opened = data_page($dbc, $_GET['id']); } break; case 'users'; if(isset($_POST['submitted']) == 1) { $first = mysqli_real_escape_string($dbc, $_POST['first']); $last = mysqli_real_escape_string($dbc, $_POST['last']); if($_POST['password'] != '') { if($_POST['password'] == $_POST['passwordv']) { $password = " password = SHA1('$_POST[password]'),"; $verfiy = true; } else { $verify = false; } } else { $verify = false; } if(isset($_POST['id']) != '') { $action = 'updated'; $q = "UPDATE users SET first = '$first', last = '$last', email = '$_POST[email]', $password status = $_POST[status] WHERE id = $_GET[id]"; } else { $action = 'added'; if($verify == true) { $q = "INSERT INTO users (first, last, email, password, status) VALUES ('$first', '$last', '$_POST[email]', SHA1('$_POST[password]'), '$_POST[status]')"; } } $r = mysqli_query($dbc, $q); if($r) { $message = '

User was '.$action.'!

'; } else { $message = '

User could not be '.$action.' because: '.mysqli_error($dbc); if($verify == false) { $message .= '

Password fields empty and/or do not match.

'; } $message .= '

Query: '.$q.'

'; } } if(isset($_GET['id'])) { $opened = data_user($dbc, $_GET['id']); } break; case 'settings'; break; default: break; } ?> ` template/navigation.php ` ` functions/data.php `'.$data['body'].'

'; } else { $data['body_formatted'] = $data['body']; } return $data; } ?>` functions/template.php ` > `
Chriswilldo commented 6 years ago

nvm. I'm not sure if I did anything, but i managed to login to the second user email that I had setup. I will let you know how things go from here.