Zrobiłem oto taki wyświetlacz newsów który ma wyświetlać po 5 newsów na strone :
<?php
$id = $_GET['newsy'];
$ilosc_newsow = 13;
$id2 = $id + 1;
$id3 = 2+ $id;
$id4 = 3 + $id;
$id5 = 4 + $id;
if (6 == $id)
{
echo('<a href="test.php?newsy=1">< Wstecz</a>'); }
include("newsy/dodane/$id.txt");
if ($id2 <= $ilosc_newsow)
{
include("newsy/dodane/$id2.txt");
}
if ($id3 <= $ilosc_newsow)
{
include("newsy/dodane/$id3.txt");
}
if ($id4 <= $ilosc_newsow)
{
include("newsy/dodane/$id4.txt");
}
if ($id5 <= $ilosc_newsow)
{
include("newsy/dodane/$id5.txt");
}
if ($id + 5 <= $ilosc_newsow)
{
echo('<a href="test.php?newsy=6">Dalej></a>'); }
?>
a dokładniej chodzi o ten fragment
<?php
if ($id + 5 <= $ilosc_newsow)
{
echo('<a href="test.php?newsy=6">Dalej></a>'); }
?>
aby zamiast
6 pisało
$id+6