Nie wiem, dlaczego tak sie zachowuje :/
Testy prosze przeprowadzac pod tym adresem (jest tez zaladowany phpinfo(); )
http://195.211.2.7/Konto probne: login(test) passwd(test)
A tu kod strony:
<?php
echo '<div>Test kroju czcionki</div>';
if ( $_SESSION['auth'] != 1 ) $_SESSION['auth'] = false;
if ( strlen( $_POST['login'] ) && strlen( $_POST['passwd'] ) ) login
( $_POST['login'], $_POST['passwd'] );
function login( $login, $passwd ) {
$passwd = md5( $passwd );
$query = mysql_query( "SELECT * FROM `account` WHERE `login`='$login' AND `passwd`='$passwd' LIMIT 1" );
if ( $mysql_num_rows( $query ) ) {
$_SESSION['auth'] = true;
$_SESSION['account-id'] = $row['id'];
$_SESSION['account-name'] = $row['name'];
$_SESSION['account-email'] = $row['email'];
}
}
/*
$login = md5( 'test' );
$passwd = md5( 'test' );
$name = 'Test';
$email = 'test@test.test';
$data = time();
mysql_query( "INSERT INTO `account` VALUES ( NULL, '$login', '$passwd', '$name', '$email', '$data' )" );
*/
?>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
* { font-family: "DejaVu Sans", Verdana; font-size: 13px; color: #777777; }
input, textarea { border: 1px solid #dddddd; background-color: #eeeeee; }
form { margin: 0px; padding: 0px; }
.package { width: 780px; margin: 0px auto; }
.login { width: 140px; margin: 0px auto; }
.align-right { text-align: right; }
.align-center { text-align: center; }
.width-90 { width: 90%; }
.move-little-lower { margin-top: 2px; }
</style>
<div>Test kroju czcionki</div>
<div class="package">
<?php
if ( ! $_SESSION['auth'] ) include( 'login.htm' );
else
?>
</div>
<form action="index.php" method="post"> <div class="align-right"><input class="align-center width-90" type="text" name="login" value="" /></div> <div class="align-right"><input class="align-center width-90" type="password" name="passwd" value="" /></div> <div class="align-right"><input class="move-little-lower" type="submit" value="Accept" /></div>