Witam,
Jak w temacie mam problem z wyswietlaniem sie stron. Sprawa wyglada nastepujaco:
1. Stworzylem strone w HTML oparta o DIV-y
2. Na stronie utworzylem galerie zdjec napisana w PHP i przechowywana w bazie MySql
3. Wszystko smiga na domowym serwerze (krasnal)
Problem pojawil sie po przeslaniu na serwer (ovh.org) wszystko bylo by dobrze gdyby nie to ze nie moge przelaczyc kolejnej strony w mojej galerii. Link sie zmienia w adresie a zdjecia caly czas pokazuje z pierwszej strony. Przegladalem rozne fora troche poczytalem ale nie moge sobie z tym poradzic, mysle ze bedzie to problem z funkcja _GET ale nawet gdyby to byla prawda nie wiem jak sie zabrac za to. Moze jest cos innego zupelnie banalnego. Prosze o zerkniecie na moj kod zdrodlowy, w razie jakis sugestii prosze o odpowiedz.
plik galerii .php
<?php
if (!isset($first)) { $first = 0; } $ltmp = 6;
$zap = mysql_query("SELECT * FROM image WHERE category='contest' LIMIT $first,$ltmp;");
echo'<div class=zdj><div class=opis>'.$wynik['image'].'</div><a href="gallery/'.$wynik['address'].'" rel="lightbox[roadtrip]"><img src="gallery/'.$wynik['address_mini'].'" border=0 height=100 width=150/></a><br><div class=comment><a href=index.php?go=20&id='.$wynik['id'].'>- Add a comment -</a></div></div>'; }
echo'<div class=navigation>';
$count = $count/$ltmp;
if ($first!=0
) print("<a href="index
.php?go
=15&first
=" . ($first-$ltmp) . "" title="Poprzednie
"><big>Ť</big></a>");
for ($i=1;$i<=$ile;$i++)
{
print("<a href="index
.php?go
=15&first
=" . ($i*$ltmp-$ltmp) . "" title="" . ($i*$ltmp-($ltmp-1)) . "-" . ($i*$ltmp) ."">");
if ($first==($i*$ltmp-$ltmp))
{
print ("<b>|" . $i . "|</b></a> "); $akt=$i; } else { print ("|" . $i . "|</a> "); }
}
if ($akt<$ile) print ("<a href="index
.php?go
=15&first
=" . ($first+$ltmp) . "" title="Następne
"><big>ť</big></a>"); ?>
plik index.php
<p>
<?
switch ($_GET['go'])
{
case 1:
include("index.php");
break;
case 2:
include("about.html");
break;
case 3:
include("schools.php");
break;
case 4:
include("experience.php");
break;
case 5:
include("contact.html");
break;
case 6:
include("boc.html");
break;
case 7:
include ("usa.html");
break;
case 8:
include("hrit.html");
break;
case 9:
include ("hrel.html");
break;
case 10:
include ("ae.html");
break;
case 11:
include ("wwszip.html");
break;
case 12:
include ("hs.html");
break;
case 13:
include ("ps.html");
break;
case 14:
include ("gallery.php");
break;
case 15:
include ("photoshopcontest.php");
break;
case 16:
include ("photoshop.php");
break;
case 17:
include ("present.php");
break;
case 18:
include ("homeland.html");
break;
case 19:
include ("usaimg.html");
break;
case 20:
include ("comment.php");
break;
case 21:
include ("teva.php");
break;
case 0:
default:
include("start.php");
}
?>
Zastanawiam sie tez czy w pliku index.php funkcja switch jest poprawana czy nie musze czegos dodac do niej. Zeby nie przeciagac tego tematu dodalem tylko kod php mam nadzieje ze to wystarczy zeby znalezc problem.
Z gory dzieki i pozdrowionka

Problem rozwiazny dzieki uprzejmosci Shavei oraz nospor.
Nalezalo zmienic
<?php
if (!isset($first)) { $first = 0; } ?>
na
<?
if (!isset($_GET['first'])) $first = 0; else $first = (int) $_GET['first'];
?>
Pozdrawiam
Ten post edytował demsey 4.07.2007, 10:47:52