The tutorial worked great. I have created a couple accounts. However, I have one issue with it.
<?php
ob_start();
session_start();
require_once 'dbconnect.php';
if( !isset($_SESSION['user']) ) {
header("Location: index.php");
exit;
}
$res=mysqli_query($conn,"SELECT * FROM users WHERE userId=".$_SESSION['user']);
$userRow=mysqli_fetch_array($res);
?>
This block of code didn’t seem to work. I was still able to access a page even when I was not logged in. Any ideas what went wrong there?
What’s your website?
Let me try it out
www.uwrfintervarsity.com
but try http://www.uwrfintervarsity.com/Entry.html
You can’t find the link without getting through to the log in page
Where’s the login.php? Signup.php? Logout.php? Home.php?
I changed the destination for Home.php and login.php. homephp is studentdatabaseview.php and login.php is stafflogin.php.
I am not letting people create accounts on it right now because only a select few can have some(the site administrators).
studentdatabaseview.php gets me to stafflogin.php when trying to access it, what’s wrong?
No that’s what I wanted. I was just able to get to http://www.uwrfintervarsity.com/Entry.html without being logged in, and I want that page to only be accessed when you are logged in.
You cannot use .html for that, use .php instead
okay. thank you. I will change that.