jeudi 26 février 2015

Why is my login not showing up my user input in php/mysql form?

I have a login form that I'm using on several pages of a member/admin login at the top of the pages. It was working perfectly until I tried to my users to login to the admin and member folder pages. Before, when I logged a user in, the user data showed up like "Welcome, Administrator, Pat" or "Welcome, Member, Julie"... now the form is showing up empty and it won't logout with the logout button.


HERE is my code for logging in:



<form method="post" id="logoutform.php">

<fieldset>
<legend>Logout</legend>

<?php
//include('includes/functions.php');
if(isset($results)){
if ((isset($_SESSION['loginName'])) === (isset($results['email']))) {
echo "Welcome, <br />";
echo "$level, <br />";
echo get_name($results);
// print_r($_POST);
print '<br />';}
else{
var_dump($results);
}
}


?> <br /> <br /> <br />
<input type="submit" name="action" value="logout" />

</fieldset></form>


Here is my logout() function:



function logout() {
$_SESSION = array();
session_destroy();
header('Location: index.php');


Any help with this will be appreciated. I've worked on it for many, many hours. God bless you to all who try to help and thank you beforehand.


Aucun commentaire:

Enregistrer un commentaire