Witam.
Mam panel administratora pod wersję PHP 5.2 gdzie wszystko ładnie działa. Gdy zmieniam na nowsza to można się zalogować ale zaraz po kliknięciu jakiegoś linku wyrzuca znów do logowania.
Co jest nie tak?
<?php include_once('config.php'); $mysql_user_name = mysql_user_name; $mysql_user_passwd = mysql_user_passwd; $mysql_name = mysql_name; $host = host; { $_SESSION['zalogowany'] = false; } function filter($data) { } { $login = filter($_POST['login']); $passwd = filter($_POST['passwd']); if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0) { $_SESSION['zalogowany'] = true; $_SESSION['login'] = $login; } else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>'; } $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia'); $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela'); $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute; if ($_SESSION['zalogowany']==true) { echo "<div style='float:left;padding:5px 20px 5px 0px'>Witaj <b><font color='red'>".$_SESSION['login']."</font></b> "; $admin = $record['status']; if($admin == "admin") { include_once('administration.php'); } else { } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Panel Administracyjny</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="pl" /> <link rel="stylesheet" type="text/css" href="theme/admin.css" /> <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script> tinymce.init({selector:'textarea', language : 'pl', entity_encoding : 'raw', height : 300, plugins: "preview,textcolor,advlist,autolink,autosave,charmap,code,emoticons,hr,image
,media,paste,spellchecker"}); </script> <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", language : "pl", entity_encoding : "raw" plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage
,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace
,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbre
aking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
ycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizese
lect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,out
dent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|
,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,c
ite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pa
gebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Skin options skin : "o2k7", skin_variant : "silver", // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> </head> <body> <?php if ($_SESSION['zalogowany']==false): <div id="admin-login-top"><img class="img" src="theme/images/login.png"> Panel Logowania</div> <div id="admin-login"> <form action="admin.php" method="post"> Login:<br/> <input class="admin-log" type="text" name="login" /><br /><br /> Hasło:<br/> <input class="admin-log" type="password" name="passwd" /><br /><br /> </div> <div id="admin-login-button"> <center><input type="submit" name="log" value="Zaloguj" /></center> </form> </div> <?php endif; ?> </body> </html> <?php ?>
<?php ?>
<?php include_once('config.php'); $mysql_user_name = mysql_user_name; $mysql_user_passwd = mysql_user_passwd; $mysql_name = mysql_name; $host = host; { $_SESSION['zalogowany'] = false; } function filter($data) { } { $login = filter($_POST['login']); $passwd = filter($_POST['passwd']); if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0) { $_SESSION['zalogowany'] = true; $_SESSION['login'] = $login; } else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>'; } $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia'); $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela'); $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute; if ($_SESSION['zalogowany']==true) { } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Panel Administracyjny</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="pl" /> <link rel="stylesheet" type="text/css" href="theme/admin.css" /> </head> <body> <?php if ($_SESSION['zalogowany']==false): zaloguj sie! </div> <?php endif; ?> </body> </html> <?php ?>
<?php include_once('config.php'); $mysql_user_name = mysql_user_name; $mysql_user_passwd = mysql_user_passwd; $mysql_name = mysql_name; $host = host; { $_SESSION['zalogowany'] = false; } function filter($data) { } { $login = filter($_POST['login']); $passwd = filter($_POST['passwd']); if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0) { $_SESSION['zalogowany'] = true; $_SESSION['login'] = $login; } else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>'; } $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia'); $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela'); $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute; if ($_SESSION['zalogowany']==true) { echo "<div style='float:left;padding:5px 20px 5px 0px'>Witaj <b><font color='red'>".$_SESSION['login']."</font></b> "; $admin = $record['status']; if($admin == "admin") { include_once('administration.php'); } else { } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Panel Administracyjny</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="pl" /> <link rel="stylesheet" type="text/css" href="theme/admin.css" /> <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script> tinymce.init({selector:'textarea', language : 'pl', entity_encoding : 'raw', height : 300, plugins: "preview,textcolor,advlist,autolink,autosave,charmap,code,emoticons,hr,image
,media,paste,spellchecker"}); </script> <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", language : "pl", entity_encoding : "raw" plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage
,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace
,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbre
aking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
ycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizese
lect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,out
dent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|
,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,c
ite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pa
gebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Skin options skin : "o2k7", skin_variant : "silver", // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> </head> <body> <?php if ($_SESSION['zalogowany']==false): <div id="admin-login-top"><img class="img" src="theme/images/login.png"> Panel Logowania</div> <div id="admin-login"> <form action="admin.php" method="post"> Login:<br/> <input class="admin-log" type="text" name="login" /><br /><br /> Hasło:<br/> <input class="admin-log" type="password" name="passwd" /><br /><br /> </div> <div id="admin-login-button"> <center><input type="submit" name="log" value="Zaloguj" /></center> </form> </div> <?php endif; ?> </body> </html>
<?php include_once('config.php'); $mysql_user_name = mysql_user_name; $mysql_user_passwd = mysql_user_passwd; $mysql_name = mysql_name; $host = host; { $_SESSION['zalogowany'] = false; } function filter($data) { } { $login = filter($_POST['login']); $passwd = filter($_POST['passwd']); if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0) { $_SESSION['zalogowany'] = true; $_SESSION['login'] = $login; } else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>'; } $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia'); $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela'); $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute; if ($_SESSION['zalogowany']==true) { echo "<div style='float:left;padding:5px 20px 5px 0px'>Witaj <b><font color='red'>".$_SESSION['login']."</font></b> "; $admin = $record['status']; if($admin == "admin") { include_once('administration.php'); } else { } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Panel Administracyjny</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="pl" /> <link rel="stylesheet" type="text/css" href="theme/admin.css" /> <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script> tinymce.init({selector:'textarea', language : 'pl', entity_encoding : 'raw', height : 300, plugins: "preview,textcolor,advlist,autolink,autosave,charmap,code,emoticons,hr,image
,media,paste,spellchecker"}); </script> <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", language : "pl", entity_encoding : "raw" plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage
,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace
,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbre
aking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
ycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizese
lect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,out
dent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|
,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,c
ite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pa
gebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Skin options skin : "o2k7", skin_variant : "silver", // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> </head> <body> <?php if ($_SESSION['zalogowany']==false): <div id="admin-login-top"><img class="img" src="theme/images/login.png"> Panel Logowania</div> <div id="admin-login"> <form action="admin.php" method="post"> Login:<br/> <input class="admin-log" type="text" name="login" /><br /><br /> Hasło:<br/> <input class="admin-log" type="password" name="passwd" /><br /><br /> </div> <div id="admin-login-button"> <center><input type="submit" name="log" value="Zaloguj" /></center> </form> </div> <?php endif; ?> </body> </html> <?php ?>
/* jakoiś kod */