2013年7月27日 星期六

php login / session

php login and pass to session

checkpassword.php
<?php
session_start();
if (empty($_SESSION[pagecheck]))
{
if (empty($_POST[logname]) or empty($_POST[logpass])) {
echo 'You did not input the login name or password.';
exit;
}elseif ($_POST[logname]=='admin' and $_POST[logpass]=='adminpass') {
$_SESSION [pageecheck]==time();
} else {
echo 'The login name or password is incorrect <p> <a href="login.php">Tray Again</a></p>';
exit;
}
}
?>

  1. _SESSION 是用大草
  2. Program while on filename.php 第一行
  3. Anything relation with session shoud write session_start()
  4. *Refer : php.ini output buffering 4096.
  5. <? php ob_start(); ?> i.e. add before session for add the buffer

沒有留言:

張貼留言