Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

2 Stron V   1 2 >  
Reply to this topicStart new topic
> [PHP]Wyświetla tylko jedna strone
Sikor89
post 15.03.2009, 12:39:03
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


Witam,
na wstepie napisze, ze jestem bardzo slaby w php, mam nadzieje, ze uda mi sie tutaj odnalezc pomoc;) Do rzeczy:
Klikajac w jakikolwiek link na stronie wyswietla sie tylko jedna strona, adres zmiania sie jednak strona glowna nie. Probklem taki jak tu: http://www.dictum.netlook.pl/tpe/ Gdy klikamy z lewej strony mendu link "statut" to statut sie nie wyswietla. Oczywiscie wszystko jest na serwerze:)
Pozdrawiam
Go to the top of the page
+Quote Post
wookieb
post 15.03.2009, 12:44:49
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




A kod to nie łaska podać?

Ten post edytował wookieb 15.03.2009, 12:45:13


--------------------
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 12:48:41
Post #3





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


CODE























































Witam Serdecznie na stronach Towarzystwa Przyjaciół Elfidy!!
Jako stowarzyszenie stawiamy sobie za cel przydewszystkim dobro naszej ukochanej prowincji, jej rozwój i rozkwit.
Zachęcamy do wspierania naszych wysiłków.







$page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
if(file_exists("images/$page1.png"))
echo"






";
else
echo"";
?>





$page="index";
}
if(file_exists("includes/$page.inc")) {
include "includes/$page.inc";
} else {
echo "Strona niedostępna!";
}
?>










Ten post edytował Sikor89 15.03.2009, 13:05:54
Go to the top of the page
+Quote Post
blooregard
post 15.03.2009, 12:53:27
Post #4


Newsman


Grupa: Moderatorzy
Postów: 2 033
Pomógł: 290
Dołączył: 21.12.2007
Skąd: Łódź




Cytat
W związki ze śmiercią założyciela i przewodniczącego TPE Tomasza Wyspiańskiego i nie wybrania nowego przewodniczącego TPE zostaje zmienione w muzeum. Jego strony zostają udostępnione wszystkim jako zbiór wielu istotnych i cennych informacji.


Wydaje mi się, że to wyjaśnia wszystko...


--------------------
Life's simple... You make choices and don't look back...
Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 12:55:09
Post #5





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


blooregard, myślę że jednak jest tam jakiś problem - zmieniają się nagłówki a treść nie.
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 12:57:29
Post #6





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


Nie, nie wyjasnia, strony powinny dzialac:)
Go to the top of the page
+Quote Post
blooregard
post 15.03.2009, 12:58:50
Post #7


Newsman


Grupa: Moderatorzy
Postów: 2 033
Pomógł: 290
Dołączył: 21.12.2007
Skąd: Łódź




Po wpisaniu tego w pasku adresu:
Cytat

wyświetla się chyba to, co powinno po kliknięciu w link "Mapa" w menu głównym.

Czyli problem jest w index.php w przypuszczalnie takiej inijce:
Kod
include($_GET['parametr'].'.php');

albo coś w tym stylu...

Ten post edytował blooregard 15.03.2009, 13:00:15


--------------------
Life's simple... You make choices and don't look back...
Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 12:59:42
Post #8





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


Sikor89, napisałem Ci na PW już - umieść kod w znacznikach bbcode bo chciałbym Ci pomóc ale teraz kod jest nieczytelny.
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 13:50:53
Post #9





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


CODE


Towarzystwo Przyjaciół Elfidy






























Witam Serdecznie na stronach Towarzystwa Przyjaciół Elfidy!!
Jako stowarzyszenie stawiamy sobie za cel przydewszystkim dobro naszej ukochanej prowincji, jej rozwój i rozkwit.
Zachęcamy do wspierania naszych wysiłków.














$page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
if(file_exists("images/$page1.png"))
echo"";
else
echo"";
?>





$page="index";
}
if(file_exists("includes/$page.inc")) {
include "includes/$page.inc";
} else {
echo "Strona niedostępna!";
}
?>






























Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 14:05:38
Post #10





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


Sikor89 - znaczniki PHP a nie CODE
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 14:21:09
Post #11





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


  1. <html>
  2.  <head>
  3.  <title>Towarzystwo Przyjaciół Elfidy</title>
  4.  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
  5.  <link rel="stylesheet" href="style.css" type="text/css">
  6.  </head>
  7.  
  8.  <body bgcolor="#008080" text="#FFF8DC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFF8DC" vlink="#FFF8DC" alink="#FFF8DC">
  9.  <table width="780" border="0" cellspacing="0" cellpadding="0" class="body" align="center">
  10.    <tr>
  11.      <td width="850" height="85" valign="top">
  12.  <? include "includes/top.inc"; ?>
  13.  
  14.  
  15.  </td>
  16.    </tr>
  17.    <tr>
  18.      <td valign="top" width="850">
  19.        <table width="760" border="0" cellspacing="0" cellpadding="0">
  20.          <tr valign="top">
  21.            <td width="165" background="images/menu.png">
  22.  
  23.  <? include "includes/menu.inc"; ?>
  24.  </td>
  25.            <td>
  26.              <table width="600" border="0" cellspacing="0" cellpadding="0" class="top">
  27.                <tr>
  28.                  <td height="18" background="images/newst2.png" valign="top">&nbsp;</td>
  29.                </tr>
  30.                <tr>
  31.                  <td background="images/newstl.png" valign="top">
  32.                    <table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="body">
  33.                      <tr>
  34.                        <td><center>Witam Serdecznie na stronach Towarzystwa Przyjaciół Elfidy!!
  35.  Jako stowarzyszenie stawiamy sobie za cel przydewszystkim dobro naszej ukochanej prowincji, jej rozwój i rozkwit.
  36.  Zachęcamy do wspierania naszych wysiłków.</center>
  37.                          
  38.                        </td>
  39.                      </tr>
  40.                    </table>
  41.                  </td>
  42.                </tr>
  43.                <tr>
  44.                  <td background="images/news_back.png" valign="bottom"><img src="images/newsb.png" width="600" height="25"></td>
  45.                </tr>
  46.              </table>
  47.              
  48.  
  49.              <table width="431" border="0" cellspacing="0" cellpadding="0" class="top">
  50.                <tr>
  51.  <?
  52.  $page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
  53.  if(file_exists("images/$page1.png"))
  54.  echo"<td height=\"31\" background=\"images/$page1.png\" valign=\"top\">";
  55.  else
  56.  echo"<td height=\"31\" background=\"images/blank.png\" valign=\"top\">";
  57.  ?>
  58.                </tr>
  59.                <tr>
  60.                  <td background="images/newstl.png" valign="top">
  61.                    <table width="550" border="0" cellspacing="0" cellpadding="0" align="center" class="body">
  62.                      <tr>
  63.                        <td><? if(!isset($page)) {
  64.  $page="index";
  65.  }
  66.  if(file_exists("includes/$page.inc")) {
  67.  include "includes/$page.inc";
  68.  } else {
  69.  echo "Strona niedostępna!";
  70.  }
  71.  ?>  
  72.                        </td>
  73.                      </tr>
  74.                    </table>
  75.                  </td>
  76.                </tr>
  77.                <tr>
  78.                  <td background="images/news_back.png" valign="bottom"><img src="images/newsb.png" width="600" height="25"></td>
  79.                </tr>
  80.              </table>
  81.              <p>&nbsp;</p>
  82.            </td>
  83.  
  84.  
  85.  
  86.  </font></div>
  87.            </td>
  88.          </tr>
  89.        </table>
  90.      </td>
  91.    </tr>
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  </table>
  99.  </body>
  100.  </html>
Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 14:25:58
Post #12





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


W tym fragmencie:
  1. <?php
  2. if(!isset($page)) {
  3. $page="index";
  4. }
  5. if(file_exists("includes/$page.inc")) {
  6. include "includes/$page.inc";
  7. } else {
  8. echo "Strona niedostępna!";
  9. }
  10. ?>

Zmień wszędzie zmienną $page na $page1 bo taka jest parę linijek wyżej inicjowana.
Natomiast zmienna $page nie jest inicjowana nigdzie i dlatego zawsze przypisywana jest do niej wartość "index" i wyświetlana jest zawsze strona index.inc.

Ten post edytował Foxx 15.03.2009, 14:26:37
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 14:35:18
Post #13





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


Prawie wszystko jest ok tylko nie wyswietla glownej strony z newsami.
http://www.dictum.netlook.pl/tpe/index.php
Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 14:44:18
Post #14





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


Pokaż jak teraz wygląda Twój kod.
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 14:46:41
Post #15





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


  1. <html>
  2. <head>
  3. <title>Towarzystwo Przyjaciół Elfidy</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
  5. <link rel="stylesheet" href="style.css" type="text/css">
  6. </head>
  7.  
  8. <body bgcolor="#008080" text="#FFF8DC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFF8DC" vlink="#FFF8DC" alink="#FFF8DC">
  9. <table width="780" border="0" cellspacing="0" cellpadding="0" class="body" align="center">
  10.  <tr>
  11.    <td width="850" height="85" valign="top">
  12. <? include "includes/top.inc"; ?>
  13.  
  14.  
  15. </td>
  16.  </tr>
  17.  <tr>
  18.    <td valign="top" width="850">
  19.      <table width="760" border="0" cellspacing="0" cellpadding="0">
  20.        <tr valign="top">
  21.          <td width="165" background="images/menu.png">
  22.  
  23. <? include "includes/menu.inc"; ?>
  24. </td>
  25.          <td>
  26.            <table width="600" border="0" cellspacing="0" cellpadding="0" class="top">
  27.              <tr>
  28.                <td height="18" background="images/newst2.png" valign="top">&nbsp;</td>
  29.              </tr>
  30.              <tr>
  31.                <td background="images/newstl.png" valign="top">
  32.                  <table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="body">
  33.                    <tr>
  34.                      <td><center>Witam Serdecznie na stronach Towarzystwa Przyjaciół Elfidy!!<br>Jako stowarzyszenie stawiamy sobie za cel przydewszystkim dobro naszej ukochanej prowincji, jej rozwój i rozkwit.<br>Zachęcamy do wspierania naszych wysiłków.</center>
  35.                        
  36.                      </td>
  37.                    </tr>
  38.                  </table>
  39.                </td>
  40.              </tr>
  41.              <tr>
  42.                <td background="images/news_back.png" valign="bottom"><img src="images/newsb.png" width="600" height="25"></td>
  43.              </tr>
  44.            </table>
  45.            <br>
  46.            <table width="431" border="0" cellspacing="0" cellpadding="0" class="top">
  47.              <tr>
  48. <?
  49. $page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
  50. if(file_exists("images/$page1.png"))
  51. echo"<td height=\"31\" background=\"images/$page1.png\" valign=\"top\">";
  52. else
  53. echo"<td height=\"31\" background=\"images/blank.png\" valign=\"top\">";
  54. ?>
  55.              </tr>
  56.              <tr>
  57.                <td background="images/newstl.png" valign="top">
  58.                  <table width="550" border="0" cellspacing="0" cellpadding="0" align="center" class="body">
  59.                    <tr>
  60.                      <td><? if(!isset($page)) {
  61. $page="index";
  62. }
  63. if(file_exists("includes/$page1.inc")) {
  64. include "includes/$page1.inc";
  65. } else {
  66. echo "Strona niedostępna!";
  67. }
  68. ?>  
  69.                      </td>
  70.                    </tr>
  71.                  </table>
  72.                </td>
  73.              </tr>
  74.              <tr>
  75.                <td background="images/news_back.png" valign="bottom"><img src="images/newsb.png" width="600" height="25"></td>
  76.              </tr>
  77.            </table>
  78.            <p>&nbsp;</p>
  79.          </td>
  80.  
  81.  
  82.  
  83. </font></div>
  84.          </td>
  85.        </tr>
  86.      </table>
  87.    </td>
  88.  </tr>
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. </table>
  96. </body>
  97. </html>
Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 14:49:05
Post #16





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


Tu także musisz zmienić na $page1:
  1. <?php
  2. if(!isset($page)) {
  3. $page="index";
  4. }
  5. ?>


Czyli:
  1. <?php
  2. if(!isset($page1)) {
  3. $page1 = "index";
  4. }
  5. ?>


Ten post edytował Foxx 15.03.2009, 14:49:36
Go to the top of the page
+Quote Post
Spawnm
post 15.03.2009, 14:51:08
Post #17





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




  1. <td><? if(!isset($page)) {
  2. $page="index";
  3. }
  4. if(file_exists("includes/$page1.inc")) {
  5. include "includes/$page1.inc";
  6. } else {
  7. echo "Strona niedostępna!";
  8. }
  9. ?>

po co ta zmienna?

  1. <?php
  2. $page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
  3. if(file_exists("images/$page1.png"))
  4. echo"<td height=\"31\" background=\"images/$page1.png\" valign=\"top\">";
  5. ?>

tu czasem nie ma literówki ? newst ?
Go to the top of the page
+Quote Post
Sikor89
post 15.03.2009, 15:06:02
Post #18





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 15.03.2009

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


Nadal nie wyswietla glownej strony
  1. <html>
  2. <head>
  3. <title>Towarzystwo Przyjaciół Elfidy</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
  5. <link rel="stylesheet" href="style.css" type="text/css">
  6. </head>
  7.  
  8. <body bgcolor="#008080" text="#FFF8DC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFF8DC" vlink="#FFF8DC" alink="#FFF8DC">
  9. <table width="780" border="0" cellspacing="0" cellpadding="0" class="body" align="center">
  10.  <tr>
  11.    <td width="850" height="85" valign="top">
  12. <? include "includes/top.inc"; ?>
  13.  
  14.  
  15. </td>
  16.  </tr>
  17.  <tr>
  18.    <td valign="top" width="850">
  19.      <table width="760" border="0" cellspacing="0" cellpadding="0">
  20.        <tr valign="top">
  21.          <td width="165" background="images/menu.png">
  22.  
  23. <? include "includes/menu.inc"; ?>
  24. </td>
  25.          <td>
  26.            <table width="600" border="0" cellspacing="0" cellpadding="0" class="top">
  27.              <tr>
  28.                <td height="18" background="images/newst2.png" valign="top">&nbsp;</td>
  29.              </tr>
  30.              <tr>
  31.                <td background="images/newstl.png" valign="top">
  32.                  <table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="body">
  33.                    <tr>
  34.                      <td><center>Witam Serdecznie na stronach Towarzystwa Przyjaciół Elfidy!!<br>Jako stowarzyszenie stawiamy sobie za cel przydewszystkim dobro naszej ukochanej prowincji, jej rozwój i rozkwit.<br>Zachęcamy do wspierania naszych wysiłków.</center>
  35.                        
  36.                      </td>
  37.                    </tr>
  38.                  </table>
  39.                </td>
  40.              </tr>
  41.              <tr>
  42.                <td background="images/news_back.png" valign="bottom"><img src="images/newsb.png" width="600" height="25"></td>
  43.              </tr>
  44.            </table>
  45.            <br>
  46.            <table width="431" border="0" cellspacing="0" cellpadding="0" class="top">
  47.              <tr>
  48. <?
  49. $page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
  50. if(file_exists("images/$page1.png"))
  51. echo"<td height=\"31\" background=\"images/$page1.png\" valign=\"top\">";
  52. else
  53. echo"<td height=\"31\" background=\"images/blank.png\" valign=\"top\">";
  54. ?>
  55.              </tr>
  56.              <tr>
  57.                <td background="images/newstl.png" valign="top">
  58.                  <table width="550" border="0" cellspacing="0" cellpadding="0" align="center" class="body">
  59.                    <tr>
  60.                      <td><? if(!isset($page1)) {
  61. $page1="index";
  62. }
  63. if(file_exists("includes/$page1.inc")) {
  64. include "includes/$page1.inc";
  65. } else {
  66. echo "Strona niedostępna!";
  67. }
  68. ?>  
  69.                      </td>
  70.                    </tr>
  71.                  </table>
  72.                </td>
  73.              </tr>
  74.              <tr>
  75.                <td background="images/news_back.png" valign="bottom"><img src="images/newsb.png" width="600" height="25"></td>
  76.              </tr>
  77.            </table>
  78.            <p>&nbsp;</p>
  79.          </td>
  80.  
  81.  
  82.  
  83. </font></div>
  84.          </td>
  85.        </tr>
  86.      </table>
  87.    </td>
  88.  </tr>
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. </table>
  96. </body>
  97. </html>
Go to the top of the page
+Quote Post
Spawnm
post 15.03.2009, 15:07:18
Post #19





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




  1. <?php
  2. $page1 = isset($_GET['page']) ? $_GET['page'] : "newst" ;
  3. ?>

zmień na
  1. <?php
  2. $page1 = (isset($_GET['page']) ) ? $_GET['page'] : "newst" ;
  3. ?>


//zobacz czy na pewno plik się nazywa newst a nie news.

Ten post edytował Spawnm 15.03.2009, 15:08:09
Go to the top of the page
+Quote Post
Foxx
post 15.03.2009, 15:08:09
Post #20





Grupa: Zarejestrowani
Postów: 896
Pomógł: 76
Dołączył: 15.11.2003
Skąd: Sosnowiec/Kraków

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


Ok, to zamień to:
  1. <?php
  2. if(!isset($page1)) {
  3.  $page1="index";
  4. }
  5. ?>

na:
  1. <?php
  2. if(!isset($_GET['page'])) {
  3.  $page1="index";
  4. }
  5. ?>
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: 14.08.2025 - 01:45