Jump to content

Login verification script


McAwesome

Recommended Posts

I've been wondering why this doesn't work, seems simple enough?!

 

Anyways, my idea is to query the users database and compare it. If it doesn't pass it'll redirect to the login.php page. otherwise the page's logic is executed.

 

I wanted the if statement to be in a function and just call the function with the required user parameter. Is this possible?

 

Thank you

 

<?php

session_start();

$_SESSION['LoggedIn'] = 1;

$_SESSION['ig_username'] = 1;

$_SESSION['ig_userlevel'] = 1;

 

if(empty($_SESSION['LoggedIn']) AND empty($_SESSION['ig_username']) AND $_SESSION['ig_userlevel'] >= $input)

 

{

die('invalid permission');

}

 

 

echo 'super, it worked!';

?>

 

Link to comment
https://forums.phpfreaks.com/topic/172070-login-verification-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.