FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


i need a single user login system





jayzee
hi guys i m in search of a single user login system in php without mysql..
hexkid
jayzee wrote:
hi guys i m in search of a single user login system in php without mysql..


index.php
Code:
<?php
session_start();
$_SESSION['logged'] = false;
if (isset($_POST)) {
  if (($_POST['username'] == '') && ($_POST['password'] == '')) {
    $_SESSION['logged'] = true;
    echo 'You are now logged in.<br>';
    exit('Feel free to <a href="browse.php">browse the site</a>.');
  } else {
    echo 'Invalid login.<br>';
    exit('<a href="' . $_SERVER['PHP_SELF'] . '">Try again</a>.');
  }
} else {
?>
<form action="" method="post">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<inputt ype="submit" value="Login">
</form>
<?php
}
?>


browse.php (and all other pages)
Code:
<?php
session_start();
if (!isset($_SESSION['logged']) || $_SESSION['logged'] !== true) {
  exit('You need to <a href="index.php">log in</a>.');
}

### insert page contents here

?>
jayzee
hexkid wrote:
jayzee wrote:
hi guys i m in search of a single user login system in php without mysql..


index.php
Code:
<?php
session_start();
$_SESSION['logged'] = false;
if (isset($_POST)) {
  if (($_POST['username'] == '') && ($_POST['password'] == '')) {
    $_SESSION['logged'] = true;
    echo 'You are now logged in.<br>';
    exit('Feel free to <a href="browse.php">browse the site</a>.');
  } else {
    echo 'Invalid login.<br>';
    exit('<a href="' . $_SERVER['PHP_SELF'] . '">Try again</a>.');
  }
} else {
?>
<form action="" method="post">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<inputt ype="submit" value="Login">
</form>
<?php
}
?>


browse.php (and all other pages)
Code:
<?php
session_start();
if (!isset($_SESSION['logged']) || $_SESSION['logged'] !== true) {
  exit('You need to <a href="index.php">log in</a>.');
}

### insert page contents here

?>


thanx alot.....
Related topics
html login system
Simple login system
how to?
Login System help
Re- designed my site!
Paying 375 frih$ plus a free website design (cont)
Developing a Login System with PHP and MySQL
Login System Tutorial Part 1 Creating Registration
Creating a member system
.: User login systems for your site :. CHEAP AND EASY!
Frih$ on offer for PHP Login System
Could someone create a really simple login system???
Login system with uploading features!
Creating safe persistent login system
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.