Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] strona wyświetlana niepoprawnie
Forum PHP.pl > Forum > Przedszkole
d3f3nd3r
Witam

Zmieniam sposób logowania do strony ale nie wiem gdzie robie błąd. 

Oto kod strony jaka powinna być poprawna widoczna z przeglądarki:

Kod
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><BR><html xmlns="http://www.w3.org/1999/xhtml"><BR><head><BR><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><BR><title></title>  <BR><meta name="Description" /><BR><meta name="Keywords" /><BR><meta name="Copyright" /><BR><meta name="Author" /><BR><link href="style.css" rel="stylesheet" type="text/css" /><BR><body><script type="text/javascript" src="http://adsrv.lua.pl/xxx/ads.js?id=107"></script> <BR>





<BR><table width="870" border="0" align="center" cellpadding="0" cellspacing="0" class="glownaramka"><BR>  <tr><BR>    <td colspan="2" ><img src="grafika/naglowek.JPG" width="870" height="100" /></td><BR>  </tr><BR>  <tr valign="top"><BR>    <td width="180" class="bloki"><p align="center" class="tytul">Artykuły</p><BR><div id="nawigacja"><BR><a href="index.php?menu=1&amp;akcja=1">Dodaj</a><BR><a href="index.php?menu=1&amp;akcja=2">Usuń</a><BR><a href="index.php?menu=1&amp;akcja=3">Edycja</a><BR><BR></div> <BR><BR><BR><p align="center" class="tytul">Strony</p><BR><div id="nawigacja"><BR><a href="index.php?menu=2&amp;akcja=1">Dodaj</a><BR><a href="index.php?menu=2&amp;akcja=2">Usuń</a><BR><a href="index.php?menu=2&amp;akcja=3">Edycja</a><BR><BR></div> <BR><BR><p align="center" class="tytul">Kategorie</p><BR><div id="nawigacja"><BR><a href="index.php?menu=3&amp;akcja=1">Dodaj</a><BR><a href="index.php?menu=3&amp;akcja=2">Usuń</a><BR><a href="index.php?menu=3&amp;akcja=3">Edycja</a><BR><BR></div> <BR>        <BR><p align="center" class="tytul">Ustawienia</p><BR><div id="nawigacja"><BR><a href="index.php?menu=4&amp;akcja=1">Edycja</a><BR></div> <BR><BR><p align="center" class="tytul">Admini</p><BR><div id="nawigacja"><BR><a href="index.php?menu=5&amp;akcja=1">Zobacz</a><BR><a href="index.php?menu=5&amp;akcja=2">Dodaj</a><BR><a href="index.php?menu=5&amp;akcja=3">Usuń</a><BR><a href="index.php?menu=5&amp;akcja=4">Edycja</a><BR><BR></div><BR><p align="center" class="tytul">Wylogowanie</p><BR><div id="nawigacja"><BR><a href="index.php?menu=6&amp;akcja=1">Wyloguj!</a><BR></div></td><BR>    <td width="690" class="srodek"><BR>    ZALOGOWANY POMYSLNIE DO PANELU ADMINISTRACYJNEGO!   </td><BR>    <BR>  </tr><BR>  <tr><BR>    <td colspan="2" class="stopka">Portal Polityczny &copy; 2008 Wszystkie prawa zastrzeżone </td><BR>  </tr><BR></table><BR></body><BR></html>


a oto kod jaki otrzymuje po zmianach:


Kod
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>"Panel administracyjny"</title>  <meta name="Description" /><meta name="Keywords" /><meta name="Copyright" /><meta name="Author" /><link href="style.css" rel="stylesheet" type="text/css" /><body><script type="text/javascript" src="http://adsrv.lua.pl/xxx/ads.js?id=107"></script> <table width="870" border="0" align="center" cellpadding="0" cellspacing="0" class="glownaramka">  <tr>    <td colspan="2" >include ("bloki/naglowek.php"</td>  </tr>  <tr valign="top">    <td width="180" class="bloki">include ("bloki/lewy.php"); </td>    <td width="690" class="srodek">    <?php        ZALOGOWANY POMYSLNIE DO PANELU ADMINISTRACYJNEGO!    ?>   </td>  </tr>  <tr>    <td colspan="2" class="stopka"><?php include ("bloki/stopka.php"); ?></td>  </tr></table></body></html>


zródło po zmianach:

Kod
<?php<BR>include ("klucz.php");<BR>include ("config/db_config.php");<BR>$db = @mysql_connect("$db_host","$db_user","$db_password");<BR>mysql_select_db("$db_name",$db);<BR>  <BR>ob_start();<BR>//-----------------------------------------<BR>//--Ladowanie Bibliotek -------------------<BR>//-----------------------------------------<BR>require_once("funkcje/functions.inc");<BR>//-----------------------------------------<BR>///////////////////////////////////////////////////////////////////////<BR>// main code<BR>session_start();<BR><BR><BR><BR>//    printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");<BR> //   printf("<html><head><title>Panel Administracyjny</title>");<BR>//    printf("<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>");<BR>//    printf("<style type=\"text/css\"> @import \"style.css\"; </style>");<BR>    <BR> //   printf("</head><body><div id=\"main\">");<BR><BR><BR>printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");<BR>printf("<html xmlns=\"http://www.w3.org/1999/xhtml\">");<BR>printf("<head>");<BR>printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");<BR>printf("<title>\"Panel administracyjny\"</title>  ");<BR>printf("<meta name=\"Description\" />");<BR>printf("<meta name=\"Keywords\" />");<BR>printf("<meta name=\"Copyright\" />");<BR>printf("<meta name=\"Author\" />");<BR>printf("<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\" />");<BR>printf("<body>");<BR><BR><BR>$_SESSION["dbLink"] = initMySQL();<BR><BR>if ($_REQUEST["action"] == "dologin")  // user chce sie logowac<BR>{<BR>    if (doLogin($_POST["nick"],$_POST["haslo"]))<BR>    {<BR> <BR><BR>print("<table width=\"870\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"glownaramka\">");<BR>print("  <tr>");<BR>print("    <td colspan=\"2\" >include (\"bloki/naglowek.php\"</td>");<BR>print("  </tr>");<BR>print("  <tr valign=\"top\">");<BR>print("    <td width=\"180\" class=\"bloki\">include (\"bloki/lewy.php\"); </td>");<BR>print("    <td width=\"690\" class=\"srodek\">");<BR>print("    <?php");<BR>    switch($_GET['menu'])<BR>     {<BR>       case 1:<BR>         include ("art_control.php");<BR>         break;<BR>     case 2:<BR>         include ("strony.php");<BR>         break;<BR>     case 3:<BR>         include ("kategorie.php");<BR>         break;<BR>     case 4:<BR>         include ("ustawienia.php");<BR>         break;<BR>     case 5:<BR>         include ("admini.php");<BR>         break;<BR>     case 6:<BR>         include ("wyloguj.php");<BR>         break;<BR> <BR>     default: <BR>print("        ZALOGOWANY POMYSLNIE DO PANELU ADMINISTRACYJNEGO!");<BR>     }<BR>  <BR> <BR>print("    ?>");<BR>print("   </td>");<BR><BR>print("  </tr>");<BR>print("  <tr>");<BR>print("    <td colspan=\"2\" class=\"stopka\"><?php include (\"bloki/stopka.php\"); ?></td>");<BR>print("  </tr>");<BR>print("</table>");<BR>print("</body>");<BR>print("</html>");<BR><BR><BR><BR><BR><BR><BR>    }<BR>    else<BR>    showLoginForm("Niepoprawny login lub haslo!");<BR>    exit();<BR>}<BR>// user chce sie wylogowac LUB jest niezalogowany <BR>if ($_GET["go"] == "logout" || !isset($_SESSION["nick"]))<BR>    logout();<BR>if (isset($_REQUEST["go"]) && in_array($_REQUEST["go"], $_SESSION["menu"]))<BR>{<BR>    showMenu();<BR>    $inc = sprintf("%s/%s.inc", DIR_INC, $_REQUEST["go"]);<BR>    require_once($inc);<BR>}<BR>else<BR>    logout();<BR>getFoot();<BR>ob_end_flush();<BR>?><BR><BR><BR><BR>                        <BR><BR>?><BR>




Pomoże ktoś z góry dzięki.
nospor
skoro w źrodle strony widac kod php, znaczy ze strona nie zostala wogole sparsowana.
Z jakim rozszerzeniem odpalasz glowny skrypt? Czy masz wogole obsluge php?

ps: przenosze
d3f3nd3r
index.php
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.