Moglby mi ktos powiedziec co jest zle ?
<?
require('../common.php');
if (isset($_POST['submit'])){
if (empty($_POST['name'])){ $messagen = '<font>Brak nazwy użytkownia</font><Br />';
}else{
$name = $_POST['name'];
}
if (empty($_POST['pass'])){ $messagep = '<font>Brak hasła</font><br />';
}else{
$pass = $_POST['pass'];
}
if($name && $pass){
$sql= "SELECT * FROM tbl_user WHERE user_name='$name' AND user_pass=md5('$pass')";
$result = $db->query($sql);
$ile = $result;
$ile_j = $ile->num_rows;
$row = $result->fetch_array(MYSQL_ASSOC);
if($result){
$sql_acces = "SELECT * FROM tbl_range WHERE range_id='{$row['user_acces']}'";
$result_acces = $db->query($sql_acces);
$row_acces = $result_acces->fetch_array(MYSQL_ASSOC);
$sql_up = "UPDATE tbl_user SET user_last_login=NOW() WHERE user_id='{$row['user_id']}'";
$result_up = $db->query($sql_up);
$_SESSION['user'] = $row;
$_SESSION['access'] = $row_acces;
header ("Location: admin.php"); }else{
header ("Location: error.php"); }
}
}
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Strona klasy 2c</title>
<link rel="stylesheet" href="styles.css" type="text/css" media="all">
<script LANGUAGE="JavaScript" SRC="script.js"></script>
</head>
<body bgcolor="#ffffff" text="#000000">
<table align="center" width="400" cellspacing="0" cellpadding="0"><tr><td><br><br><br><br><br><br>';
table_open('Logowanie');
echo '<form method="post" action="index.php"> <table align="center" border="0">
<tr>
<td align="right">Login:</td>
<td><input type="text" name="name" size="30"></td>
</tr>
<tr>
<td align="right">Hasło:</td>
<td><input type="password" name="pass" size="30"></td>
</tr>
<tr>
<td align="right"> </td>
<td>
<p align="center"><input style="font-weight: bold;" type="submit" name="submit" value="loguj">
</td></tr>
</table>
</form>';
table_end();
echo '</td></tr></table>';
?>
O to błedy
Kod
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Programy\WebServ\httpd-users\cms_proximo\admin\index.php:1) in C:\Programy\WebServ\httpd-users\cms_proximo\admin\index.php on line 36
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Programy\WebServ\httpd-users\cms_proximo\admin\index.php:1) in C:\Programy\WebServ\httpd-users\cms_proximo\admin\index.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at C:\Programy\WebServ\httpd-users\cms_proximo\admin\index.php:1) in C:\Programy\WebServ\httpd-users\cms_proximo\admin\index.php on line 41
Podobne bledy mam w innym pliku: admin.php -> z sesjami :/
zastosowalem ob_start i ob_end_flush ale dalej bledy sa ;/
Ten post edytował proximo 4.03.2007, 20:19:31