Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

2 Stron V   1 2 >  
Reply to this topicStart new topic
> Logowanie w wersji php 5.2, Logowanie php 52 działa
awek520
post 28.05.2019, 23:01:48
Post #1





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 28.08.2013

Ostrzeżenie: (20%)
X----


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?
Go to the top of the page
+Quote Post
viking
post 29.05.2019, 05:13:42
Post #2





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


Do mechanika jedziesz z opisem i zostawiasz auto w domu? Podaj kod.


--------------------
Go to the top of the page
+Quote Post
Tomplus
post 29.05.2019, 06:06:47
Post #3





Grupa: Zarejestrowani
Postów: 1 836
Pomógł: 225
Dołączył: 20.03.2005
Skąd: Będzin

Ostrzeżenie: (0%)
-----


Poczytaj logi.
Go to the top of the page
+Quote Post
awek520
post 29.05.2019, 10:27:09
Post #4





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 28.08.2013

Ostrzeżenie: (20%)
X----


  1. <?php
  2. include_once('config.php');
  3.  
  4. $mysql_user_name = mysql_user_name;
  5. $mysql_user_passwd = mysql_user_passwd;
  6. $mysql_name = mysql_name;
  7. $host = host;
  8.  
  9.  
  10. $sql = mysql_connect($host,$mysql_user_name,$mysql_user_passwd)
  11. or die('Nie mogę połączyć się z bazą danych: '.mysql_error());
  12.  
  13. mysql_select_db($mysql_name,$sql)
  14. or die('Nie mogę wybrać bazy: '.mysql_error());
  15.  
  16. mysql_query('SET NAMES utf8');
  17.  
  18. if (isset($_GET['logout'])==1)
  19. {
  20. $_SESSION['zalogowany'] = false;
  21. }
  22.  
  23. function filter($data)
  24. {
  25. $data = stripslashes($data);
  26.  
  27. }
  28.  
  29. if (isset($_POST['log']))
  30. {
  31. $login = filter($_POST['login']);
  32. $passwd = filter($_POST['passwd']);
  33. $passwd_md5 = md5($passwd);
  34.  
  35. if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0)
  36. {
  37.  
  38. $_SESSION['zalogowany'] = true;
  39. $_SESSION['login'] = $login;
  40.  
  41. }
  42. else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>';
  43. }
  44.  
  45. $day = date('d');
  46. $day_of_the_week = date('l');
  47. $month = date('n');
  48. $year = date('Y');
  49. $hourminute = date('G:i');
  50.  
  51. $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia');
  52.  
  53. $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela');
  54.  
  55. $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute;
  56.  
  57. if ($_SESSION['zalogowany']==true)
  58. {
  59. echo"<div id='log-ap'>";
  60. echo"<div id='log-ap-info'>";
  61. echo "<div style='float:left;padding:5px 20px 5px 0px'>Witaj <b><font color='red'>".$_SESSION['login']."</font></b> ";
  62.  
  63. echo "<a href='?logout=1'>[Wyloguj]</a></div> <div class='right'>".$time."</div></div>";
  64. $result = mysql_query("SELECT * FROM user WHERE login = '".$_SESSION['login']."'");
  65. $record = mysql_fetch_array($result, MYSQL_ASSOC);
  66. $admin = $record['status'];
  67. if($admin == "admin")
  68. {
  69. include_once('administration.php');
  70. }
  71. else
  72. {
  73. echo "<br/>User";
  74. }
  75. echo "</div>";
  76. }
  77. ?>
  78.  
  79. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  80. <html>
  81. <head>
  82. <title>Panel Administracyjny</title>
  83. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  84. <meta http-equiv="content-language" content="pl" />
  85. <link rel="stylesheet" type="text/css" href="theme/admin.css" />
  86. <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
  87. <script>
  88. 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"});
  89. </script>
  90. <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({
  91. // General options
  92. mode : "textareas",
  93. theme : "advanced",
  94. language : "pl",
  95. entity_encoding : "raw"
  96. 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",
  97. // Theme options
  98. theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
    ycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizese
    lect",
  99. 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",
  100. theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
    ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
  101. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,c
    ite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pa
    gebreak,|,insertfile,insertimage",
  102. theme_advanced_toolbar_location : "top",
  103. theme_advanced_toolbar_align : "left",
  104. theme_advanced_statusbar_location : "bottom",
  105. theme_advanced_resizing : true,
  106. // Skin options
  107. skin : "o2k7",
  108. skin_variant : "silver",
  109. // Example content CSS (should be your site CSS)
  110. content_css : "css/example.css",
  111. // Drop lists for link/image/media/template dialogs
  112. template_external_list_url : "js/template_list.js",
  113. external_link_list_url : "js/link_list.js",
  114. external_image_list_url : "js/image_list.js",
  115. media_external_list_url : "js/media_list.js",
  116. // Replace values for the template plugin
  117. template_replace_values : {
  118. username : "Some User",
  119. staffid : "991234"
  120. } }); </script>
  121. </head>
  122. <body>
  123.  
  124. <?php if ($_SESSION['zalogowany']==false):
  125. echo $error_data; ?>
  126.  
  127. <div id="admin-login-top"><img class="img" src="theme/images/login.png"> Panel Logowania</div>
  128. <div id="admin-login">
  129. <form action="admin.php" method="post">
  130. Login:<br/> <input class="admin-log" type="text" name="login" /><br /><br />
  131. Hasło:<br/> <input class="admin-log" type="password" name="passwd" /><br /><br />
  132. </div>
  133. <div id="admin-login-button">
  134. <center><input type="submit" name="log" value="Zaloguj" /></center>
  135. </form>
  136. </div>
  137. <?php
  138. endif;
  139. ?>
  140. </body>
  141. </html>
  142. <?php
  143. mysql_close($sql);
  144. ?>
Go to the top of the page
+Quote Post
viking
post 29.05.2019, 10:31:59
Post #5





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


Do jakiej konkretnie wersji php podnosisz? Kod jest strasznie przestarzały.


--------------------
Go to the top of the page
+Quote Post
awek520
post 29.05.2019, 10:44:44
Post #6





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 28.08.2013

Ostrzeżenie: (20%)
X----


Aktualnie mam 5.2, a firma gdzie mam hosting zmienia na 5.3 min.

Wiem wiem, ale nie bardzo znam się na tych wszystkich wersjach..
Go to the top of the page
+Quote Post
viking
post 29.05.2019, 10:50:50
Post #7





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


Wow. Wsparcie dla 5.3 zakończyło się prawie 5 lat temu. Zmian pomiędzy 5.2 na poziomie kodu który pokazałeś za dużo nie było. Pewnie chodzi o coś innego w konfiguracji PHP. Co w logasz masz?


--------------------
Go to the top of the page
+Quote Post
awek520
post 29.05.2019, 10:59:06
Post #8





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 28.08.2013

Ostrzeżenie: (20%)
X----


Chodzi o konsole tak?
Jak już coś klikam to wyskakuje że pole hasło obecne na zabezpieczonej (http) stronie. Stanowi to zagrożenie itd
Go to the top of the page
+Quote Post
viking
post 29.05.2019, 11:00:41
Post #9





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


Chodzi o error logi serwera.


--------------------
Go to the top of the page
+Quote Post
awek520
post 29.05.2019, 11:16:04
Post #10





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 28.08.2013

Ostrzeżenie: (20%)
X----


Wszystko jest ze file does not exist

Sprawdziłem też że gdy zmienie strone na protokół ssl z https to także wywala..

Ten post edytował awek520 29.05.2019, 11:59:13
Go to the top of the page
+Quote Post
Tomplus
post 29.05.2019, 19:12:19
Post #11





Grupa: Zarejestrowani
Postów: 1 836
Pomógł: 225
Dołączył: 20.03.2005
Skąd: Będzin

Ostrzeżenie: (0%)
-----


Na pewno masz wersję PHP 5.3?

stwórz plik phpinfo.php
a tam kod:

  1. <?php
  2. ?>


Będziesz wiedział co masz na hostingu.

włącz sobie:

na początku plików np. index.php
Powinno wywalać ci prawdziwe błędy od razu, ew. możesz mieć ustawione tą opcję wywalania błędów w opcjach hostingu.

Go to the top of the page
+Quote Post
awek
post 30.05.2019, 11:44:07
Post #12





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 19.12.2015

Ostrzeżenie: (0%)
-----


Sluchajcie..
Zmienialem wersje na php 5.6, stworzyłem plik bla.php o zawartosci

  1. <?php
  2. include_once('config.php');
  3.  
  4. $mysql_user_name = mysql_user_name;
  5. $mysql_user_passwd = mysql_user_passwd;
  6. $mysql_name = mysql_name;
  7. $host = host;
  8.  
  9.  
  10. $sql = mysql_connect($host,$mysql_user_name,$mysql_user_passwd)
  11. or die('Nie mogę połączyć się z bazą danych: '.mysql_error());
  12.  
  13. mysql_select_db($mysql_name,$sql)
  14. or die('Nie mogę wybrać bazy: '.mysql_error());
  15.  
  16. mysql_query('SET NAMES utf8');
  17.  
  18. if (isset($_GET['logout'])==1)
  19. {
  20. $_SESSION['zalogowany'] = false;
  21. }
  22.  
  23. function filter($data)
  24. {
  25. $data = stripslashes($data);
  26.  
  27. }
  28.  
  29. if (isset($_POST['log']))
  30. {
  31. $login = filter($_POST['login']);
  32. $passwd = filter($_POST['passwd']);
  33. $passwd_md5 = md5($passwd);
  34.  
  35. if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0)
  36. {
  37.  
  38. $_SESSION['zalogowany'] = true;
  39. $_SESSION['login'] = $login;
  40.  
  41. }
  42. else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>';
  43. }
  44.  
  45. $day = date('d');
  46. $day_of_the_week = date('l');
  47. $month = date('n');
  48. $year = date('Y');
  49. $hourminute = date('G:i');
  50.  
  51. $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia');
  52.  
  53. $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela');
  54.  
  55. $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute;
  56.  
  57. if ($_SESSION['zalogowany']==true)
  58. {
  59. echo "Witaj ".$SESSION['login']."";
  60. }
  61. ?>
  62.  
  63. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  64. <html>
  65. <head>
  66. <title>Panel Administracyjny</title>
  67. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  68. <meta http-equiv="content-language" content="pl" />
  69. <link rel="stylesheet" type="text/css" href="theme/admin.css" />
  70. </head>
  71. <body>
  72.  
  73. <?php if ($_SESSION['zalogowany']==false):
  74. echo $error_data; ?>
  75.  
  76. zaloguj sie!
  77. </div>
  78. <?php
  79. endif;
  80. ?>
  81. </body>
  82. </html>
  83. <?php
  84. mysql_close($sql);
  85. ?>


a admin.php

  1. <?php
  2. include_once('config.php');
  3.  
  4. $mysql_user_name = mysql_user_name;
  5. $mysql_user_passwd = mysql_user_passwd;
  6. $mysql_name = mysql_name;
  7. $host = host;
  8.  
  9.  
  10. $sql = mysql_connect($host,$mysql_user_name,$mysql_user_passwd)
  11. or die('Nie mogę połączyć się z bazą danych: '.mysql_error());
  12.  
  13. mysql_select_db($mysql_name,$sql)
  14. or die('Nie mogę wybrać bazy: '.mysql_error());
  15.  
  16. mysql_query('SET NAMES utf8');
  17.  
  18. if (isset($_GET['logout'])==1)
  19. {
  20. $_SESSION['zalogowany'] = false;
  21. }
  22.  
  23. function filter($data)
  24. {
  25. $data = stripslashes($data);
  26.  
  27. }
  28.  
  29. if (isset($_POST['log']))
  30. {
  31. $login = filter($_POST['login']);
  32. $passwd = filter($_POST['passwd']);
  33. $passwd_md5 = md5($passwd);
  34.  
  35. if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0)
  36. {
  37.  
  38. $_SESSION['zalogowany'] = true;
  39. $_SESSION['login'] = $login;
  40.  
  41. }
  42. else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>';
  43. }
  44.  
  45. $day = date('d');
  46. $day_of_the_week = date('l');
  47. $month = date('n');
  48. $year = date('Y');
  49. $hourminute = date('G:i');
  50.  
  51. $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia');
  52.  
  53. $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela');
  54.  
  55. $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute;
  56.  
  57. if ($_SESSION['zalogowany']==true)
  58. {
  59. echo"<div id='log-ap'>";
  60. echo"<div id='log-ap-info'>";
  61. echo "<div style='float:left;padding:5px 20px 5px 0px'>Witaj <b><font color='red'>".$_SESSION['login']."</font></b> ";
  62.  
  63. echo "<a href='?logout=1'>[Wyloguj]</a></div> <div class='right'>".$time."</div></div>";
  64. $result = mysql_query("SELECT * FROM user WHERE login = '".$_SESSION['login']."'");
  65. $record = mysql_fetch_array($result, MYSQL_ASSOC);
  66. $admin = $record['status'];
  67. if($admin == "admin")
  68. {
  69. include_once('administration.php');
  70. }
  71. else
  72. {
  73. echo "<br/>User";
  74. }
  75. echo "</div>";
  76. echo "Witaj ".$SESSION['login']."";
  77. }
  78. ?>
  79.  
  80. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  81. <html>
  82. <head>
  83. <title>Panel Administracyjny</title>
  84. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  85. <meta http-equiv="content-language" content="pl" />
  86. <link rel="stylesheet" type="text/css" href="theme/admin.css" />
  87. <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
  88. <script>
  89. 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"});
  90. </script>
  91. <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({
  92. // General options
  93. mode : "textareas",
  94. theme : "advanced",
  95. language : "pl",
  96. entity_encoding : "raw"
  97. 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",
  98. // Theme options
  99. theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
    ycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizese
    lect",
  100. 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",
  101. theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
    ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
  102. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,c
    ite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pa
    gebreak,|,insertfile,insertimage",
  103. theme_advanced_toolbar_location : "top",
  104. theme_advanced_toolbar_align : "left",
  105. theme_advanced_statusbar_location : "bottom",
  106. theme_advanced_resizing : true,
  107. // Skin options
  108. skin : "o2k7",
  109. skin_variant : "silver",
  110. // Example content CSS (should be your site CSS)
  111. content_css : "css/example.css",
  112. // Drop lists for link/image/media/template dialogs
  113. template_external_list_url : "js/template_list.js",
  114. external_link_list_url : "js/link_list.js",
  115. external_image_list_url : "js/image_list.js",
  116. media_external_list_url : "js/media_list.js",
  117. // Replace values for the template plugin
  118. template_replace_values : {
  119. username : "Some User",
  120. staffid : "991234"
  121. } }); </script>
  122. </head>
  123. <body>
  124.  
  125. <?php if ($_SESSION['zalogowany']==false):
  126. echo $error_data; ?>
  127.  
  128. <div id="admin-login-top"><img class="img" src="theme/images/login.png"> Panel Logowania</div>
  129. <div id="admin-login">
  130. <form action="admin.php" method="post">
  131. Login:<br/> <input class="admin-log" type="text" name="login" /><br /><br />
  132. Hasło:<br/> <input class="admin-log" type="password" name="passwd" /><br /><br />
  133. </div>
  134. <div id="admin-login-button">
  135. <center><input type="submit" name="log" value="Zaloguj" /></center>
  136. </form>
  137. </div>
  138. <?php
  139. endif;
  140. ?>
  141. </body>
  142. </html>


i działa tylkp wtedy kiedy mam właczona karte z plikiem bla.php..
jesli nie mam tej karty to nie działa..

teraz juz sam jestem z tego glupi..
Go to the top of the page
+Quote Post
Tomplus
post 31.05.2019, 03:11:24
Post #13





Grupa: Zarejestrowani
Postów: 1 836
Pomógł: 225
Dołączył: 20.03.2005
Skąd: Będzin

Ostrzeżenie: (0%)
-----


Skorzystałeś z mojej rady? czyli użycie funkcji error_reporting()

oraz powiedzenie nam, czy masz błędy w error_logs (znajdziesz je na serwerze ~./logs/error_logs/ lub podobnym miejscu
Go to the top of the page
+Quote Post
awek
post 31.05.2019, 10:39:45
Post #14





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 19.12.2015

Ostrzeżenie: (0%)
-----


wersje mam php 5.6

logi:

jesli wywala to:
198 error 5.173.96.24 Fri May 31 11:36:54 2019 FastCGI: server "/etc/www/php/fpm/saser-php56" stderr: PHP message: PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/saser/public_html/admin.php:1) in /home/saser/public_html/admin.php on line 2, referer: http://djsaser.pl/admin.php
199 error 5.173.96.24 Fri May 31 11:36:54 2019 FastCGI: server "/etc/www/php/fpm/saser-php56" stderr: PHP message: PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/saser/public_html/admin.php:1) in /home/saser/public_html/admin.php on line 2, referer: http://djsaser.pl/admin.php
200 error 5.173.96.24 Fri May 31 11:36:54 2019 File does not exist: /home/saser/public_html/js/tinymce/jscripts, referer: http://djsaser.pl/admin.php?admin=oferta2019


jeśli mam bla.php odswiezane to:

204 error 5.173.96.24 Fri May 31 11:38:29 2019 FastCGI: server "/etc/www/php/fpm/saser-php56" stderr: PHP message: PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/saser/public_html/admin.php:1) in /home/saser/public_html/admin.php on line 2, referer: http://djsaser.pl/admin.php
205 error 5.173.96.24 Fri May 31 11:38:29 2019 File does not exist: /home/saser/public_html/js/tinymce/jscripts, referer: http://djsaser.pl/admin.php?admin=offer


Nie wiem jak tej funkcji uzyc.. jeśli dodam to na poczatku strony to sie nie wyswietla wgl.
Go to the top of the page
+Quote Post
viking
post 31.05.2019, 10:41:40
Post #15





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


No i widzisz. Teraz wiadomo że wysyłasz treść i sesja wcale się nie ustawia. Pewnie w configu jest jakiś znak biały albo echo.


--------------------
Go to the top of the page
+Quote Post
awek
post 31.05.2019, 10:53:43
Post #16





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 19.12.2015

Ostrzeżenie: (0%)
-----


config.php o ten plik chodzi ?

  1. <?php
  2. define('mysql_user_name','**');
  3. define('mysql_user_passwd','('*****');
  4. define('mysql_name','**');
  5. define('host','sql5.*****.pl');
  6. ?>


Ten post edytował awek 31.05.2019, 10:54:17
Go to the top of the page
+Quote Post
nospor
post 31.05.2019, 11:15:57
Post #17





Grupa: Moderatorzy
Postów: 36 455
Pomógł: 6292
Dołączył: 27.12.2004




Zgodnie z logiem chodzi o plik
/home/saser/public_html/admin.php


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
awek
post 31.05.2019, 11:46:57
Post #18





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 19.12.2015

Ostrzeżenie: (0%)
-----


No to oto kod


  1. <?php
  2. include_once('config.php');
  3.  
  4. $mysql_user_name = mysql_user_name;
  5. $mysql_user_passwd = mysql_user_passwd;
  6. $mysql_name = mysql_name;
  7. $host = host;
  8.  
  9.  
  10. $sql = mysql_connect($host,$mysql_user_name,$mysql_user_passwd)
  11. or die('Nie mogę połączyć się z bazą danych: '.mysql_error());
  12.  
  13. mysql_select_db($mysql_name,$sql)
  14. or die('Nie mogę wybrać bazy: '.mysql_error());
  15.  
  16. mysql_query('SET NAMES utf8');
  17.  
  18. if (isset($_GET['logout'])==1)
  19. {
  20. $_SESSION['zalogowany'] = false;
  21. }
  22.  
  23. function filter($data)
  24. {
  25. $data = stripslashes($data);
  26.  
  27. }
  28.  
  29. if (isset($_POST['log']))
  30. {
  31. $login = filter($_POST['login']);
  32. $passwd = filter($_POST['passwd']);
  33. $passwd_md5 = md5($passwd);
  34.  
  35. if (mysql_num_rows(mysql_query("SELECT login, pass FROM user WHERE login = '".$login."' AND pass = '".$passwd_md5."';")) > 0)
  36. {
  37.  
  38. $_SESSION['zalogowany'] = true;
  39. $_SESSION['login'] = $login;
  40.  
  41. }
  42. else $error_data = '<div id="admin-login-error"><img class="img" src="theme/images/error.png"> Wpisano złe dane!</div>';
  43. }
  44.  
  45. $day = date('d');
  46. $day_of_the_week = date('l');
  47. $month = date('n');
  48. $year = date('Y');
  49. $hourminute = date('G:i');
  50.  
  51. $month_pl = array(1 => 'Stycznia', 'Lutego', 'Marca', 'Kwietnia', 'Maja', 'Czerwca', 'Lipca', 'Sierpnia', 'Września', 'Października', 'Listopada', 'Grudnia');
  52.  
  53. $day_of_the_week_pl = array('Monday' => 'Poniedziałek', 'Tuesday' => 'Wtorek', 'Wednesday' => 'Środa', 'Thursday' => 'Czwartek', 'Friday' => 'Piątek', 'Saturday' => 'Sobota', 'Sunday' => 'Niedziela');
  54.  
  55. $time = $day_of_the_week_pl[$day_of_the_week].", ".$day." ".$month_pl[$month]." ".$year."r. ".$hourminute;
  56.  
  57. if ($_SESSION['zalogowany']==true)
  58. {
  59. echo"<div id='log-ap'>";
  60. echo"<div id='log-ap-info'>";
  61. echo "<div style='float:left;padding:5px 20px 5px 0px'>Witaj <b><font color='red'>".$_SESSION['login']."</font></b> ";
  62.  
  63. echo "<a href='?logout=1'>[Wyloguj]</a></div> <div class='right'>".$time."</div></div>";
  64. $result = mysql_query("SELECT * FROM user WHERE login = '".$_SESSION['login']."'");
  65. $record = mysql_fetch_array($result, MYSQL_ASSOC);
  66. $admin = $record['status'];
  67. if($admin == "admin")
  68. {
  69. include_once('administration.php');
  70. }
  71. else
  72. {
  73. echo "<br/>User";
  74. }
  75. echo "</div>";
  76. }
  77. ?>
  78.  
  79. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  80. <html>
  81. <head>
  82. <title>Panel Administracyjny</title>
  83. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  84. <meta http-equiv="content-language" content="pl" />
  85. <link rel="stylesheet" type="text/css" href="theme/admin.css" />
  86. <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
  87. <script>
  88. 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"});
  89. </script>
  90. <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({
  91. // General options
  92. mode : "textareas",
  93. theme : "advanced",
  94. language : "pl",
  95. entity_encoding : "raw"
  96. 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",
  97. // Theme options
  98. theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
    ycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizese
    lect",
  99. 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",
  100. theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
    ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
  101. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,c
    ite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pa
    gebreak,|,insertfile,insertimage",
  102. theme_advanced_toolbar_location : "top",
  103. theme_advanced_toolbar_align : "left",
  104. theme_advanced_statusbar_location : "bottom",
  105. theme_advanced_resizing : true,
  106. // Skin options
  107. skin : "o2k7",
  108. skin_variant : "silver",
  109. // Example content CSS (should be your site CSS)
  110. content_css : "css/example.css",
  111. // Drop lists for link/image/media/template dialogs
  112. template_external_list_url : "js/template_list.js",
  113. external_link_list_url : "js/link_list.js",
  114. external_image_list_url : "js/image_list.js",
  115. media_external_list_url : "js/media_list.js",
  116. // Replace values for the template plugin
  117. template_replace_values : {
  118. username : "Some User",
  119. staffid : "991234"
  120. } }); </script>
  121. </head>
  122. <body>
  123.  
  124. <?php if ($_SESSION['zalogowany']==false):
  125. echo $error_data; ?>
  126.  
  127. <div id="admin-login-top"><img class="img" src="theme/images/login.png"> Panel Logowania</div>
  128. <div id="admin-login">
  129. <form action="admin.php" method="post">
  130. Login:<br/> <input class="admin-log" type="text" name="login" /><br /><br />
  131. Hasło:<br/> <input class="admin-log" type="password" name="passwd" /><br /><br />
  132. </div>
  133. <div id="admin-login-button">
  134. <center><input type="submit" name="log" value="Zaloguj" /></center>
  135. </form>
  136. </div>
  137. <?php
  138. endif;
  139. ?>
  140. </body>
  141. </html>
  142. <?php
  143. mysql_close($sql);
  144. ?>


Go to the top of the page
+Quote Post
nospor
post 31.05.2019, 11:51:29
Post #19





Grupa: Moderatorzy
Postów: 36 455
Pomógł: 6292
Dołączył: 27.12.2004




Wg komunikatu bledu masz tam jakis bialy znak na poczatku pliku ewentualnie, zreszta bardzo prawdopodobne, BOM - zapisz ten plik bez BOM. Kazdy edytor ma taka opcje


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
awek520
post 31.05.2019, 14:52:53
Post #20





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 28.08.2013

Ostrzeżenie: (20%)
X----


Bez BOM mam zapisane... Sprawdzałem juz
Go to the top of the page
+Quote Post

2 Stron V   1 2 >
Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.04.2024 - 01:54