Problem z include

Wszystko o językach skryptowych takich jak PHP i Perl, serwerach WWW, CGI, bazach danych i języku SQL.
waltorix
Posty: 4
Rejestracja: 28 mar 2015, 15:04:09
Płeć: Niewybrana
User Agent: Chrome Windows

Problem z include

Post autor: waltorix »

witam jestem nowy i mam problem z skryptem php który ma za zadanie wyswietlac mi strone w tabelce z menu np
klikne w ikonke cennik to pod tym powinna mi sie wyswietlic zawartośc strony cennik.php

zawartość index.php
<center>
<body background="grafika/tlo.jpg">
<table border="1" width="950px">
<tr>
<td align="center" valign="middle">
<?php include "data/naglowek.php"; ?>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<?php include "data/menu.php"; ?>
</td>
</tr>
<tr>
<td align="center" valign="middle">

<?php
error_reporting(0);
$st = $_GET['st'];
if(!empty($st))
{
if(is_file("data/$st.php")) include "data/$st.php";
}
else include "data/start.php";
?>
</td>
</tr>
<td align="center" valign="middle">
<?php include "data/stopka.php"; ?>
</td>
</tr>
</table>
</body>
</center>
a tutaj zawartość pliku menu.php
<a href="index.php"><img src="grafika/stronaglowna.gif" width="150"/></a>
<a href="index.php?st=oferty.php"><img src="grafika/oferty.gif"width="150"/></a>
<a href="index.php?st=galeria.php"><img src="grafika/galeria.gif"width="150"/></a>
<a href="index.php?st=cennik.php"><img src="grafika/cennik.gif"width="150"/></a>
<a href="index.php?st=inforamcje.php"><img src="grafika/informacje.gif"width="150"/></a>
<a href="index.php?st=kontakt.php"><img src="grafika/kontakt.gif"width="150"/></a>
3 dni sie męcze i nie wiem o co chodzi
4zywioly
Posty: 528
Rejestracja: 26 kwie 2011, 16:33:42
Strona na CBA.pl: 4zywioly.c0.pl
Płeć: Niewybrana
User Agent: Chrome Windows 1366x768
Kontakt:

Re: Problem z include

Post autor: 4zywioly »

W menu masz odnośnik do index.php?st=cennik.php
a w include masz $st.php czyli obecnie includujesz plik cennik.php.php
waltorix
Posty: 4
Rejestracja: 28 mar 2015, 15:04:09
Płeć: Niewybrana
User Agent: Chrome Windows 1366x768

Re: Problem z include

Post autor: waltorix »

czyli wystarczy usunąć .php ? z linijki
po22
Posty: 404
Rejestracja: 02 sty 2015, 14:57:43
Płeć: Niewybrana
User Agent: Firefox Linux 1143x858

Re: Problem z include

Post autor: po22 »

waltorix, tak usun w jednym miejscu.
Czy wiesz, że:
  • W Panelu CBA w sekcji "wsparcie" jest dedykowany system ticketów (obsługi technicznej)
  • Odpowiadamy na Forum oraz na adres mailowy obsluga(malpa)cba.pl
  • Jesteśmy również na Facebooku! Znajdź nas na facebook.com/hostingcba | cba.pl
W czym jeszcze możemy pomóc?
waltorix
Posty: 4
Rejestracja: 28 mar 2015, 15:04:09
Płeć: Niewybrana
User Agent: Chrome Windows 1366x768

Re: Problem z include

Post autor: waltorix »

a mogl by mi ktos wskazac gdzie dokladnie bo usunalem ale nic nie pomaga
po22
Posty: 404
Rejestracja: 02 sty 2015, 14:57:43
Płeć: Niewybrana
User Agent: Firefox Linux 1143x858

Re: Problem z include

Post autor: po22 »

przykladowo tutaj

Kod: Zaznacz cały

<a href="index.php"><img src="grafika/stronaglowna.gif" width="150"/></a>
<a href="index.php?st=oferty.php"><img src="grafika/oferty.gif"width="150"/></a>
<a href="index.php?st=galeria.php"><img src="grafika/galeria.gif"width="150"/></a>
<a href="index.php?st=cennik.php"><img src="grafika/cennik.gif"width="150"/></a>
<a href="index.php?st=inforamcje.php"><img src="grafika/informacje.gif"width="150"/></a>
<a href="index.php?st=kontakt.php"><img src="grafika/kontakt.gif"width="150"/></a> 
zrob index.php?st=ofety itd.
Czy wiesz, że:
  • W Panelu CBA w sekcji "wsparcie" jest dedykowany system ticketów (obsługi technicznej)
  • Odpowiadamy na Forum oraz na adres mailowy obsluga(malpa)cba.pl
  • Jesteśmy również na Facebooku! Znajdź nas na facebook.com/hostingcba | cba.pl
W czym jeszcze możemy pomóc?
waltorix
Posty: 4
Rejestracja: 28 mar 2015, 15:04:09
Płeć: Niewybrana
User Agent: Chrome Windows 1366x768

Re: Problem z include

Post autor: waltorix »

wielkie dzieki a ja cały czas szukałem problemu w indexie :)
myślę ze można temat zamknąć :)
ODPOWIEDZ