<?
$posts = file("config.txt"
;
$postcount = count($posts);
$postinfo = explode(":",$posts[0]);
$pages = $postinfo[1];
$totalposts = $postinfo[0];
if ($startcounter > "-2"
$check="yes";
echo "posts: $postcount <br> page: $pages <br> total: $totalposts<br> start: $startcount<br> end: $endcount <br>check: $check <br><br>";
if ($postcount==0) echo "No news is available!";
else
{
if (empty($startcount))
{
for($i=1; $i < $pages + 1; $i++)
{
if (!empty($posts[$i]))
{
//"/home/error-pr/public_html/test/news/$posts[$i]"
include trim($posts[$i]); echo "<br><br><br>";
}
else
{
exit;
}
}
$startcount = $pages+1;
$endcount = $startcount+$pages-1;
echo "<a href='news.php?startcount=$startcount&endcount=$endcount'>next</a>";
}
else
{
for($x=$startcount; $x <= $endcount; $x++)
{
if (!empty($posts[$x]))
{
include trim($posts[$x]); echo "<br><br><br>";
}
else
{
$xstart = $startcount-$pages;
$xend = $endcount-$pages;
echo "<a href='news.php?startcount=$xstart&endcount=$xend'>back</a>";
exit;
}
}
$xstart = $startcount-$pages;
$xend = $endcount-$pages;
if ($check="yes"
{
$startcount = $endcount+1;
$endcount = $startcount+$pages-1;
echo "<a href='news.php?startcount=$xstart&endcount=$xend'>back</a> + <a href='news.php?startcount=$startcount&endcount=$endcount'>next</a>";
}
else
{
$startcount = $endcount+1;
$endcount = $startcount+$pages-1;
echo "<a href='news.php?startcount=$startcount&endcount=$endcount'>next</a>";
}
}
}
?>
its supposed to make it so the first page after it has been press back to.. form the next page that it wont have the back button leading it into the nothingness... i was thinking i should do it off the startcount or endcount and i have... and say the startcount is 1 and i do a check if it is <=1 and it will turn out false.. theni can crack it up to <=5 and it still sats its false... maybe someoen can look over he code and point out what im doing wrong :/ thanks!
in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
$posts = file("config.txt"

$postcount = count($posts);
$postinfo = explode(":",$posts[0]);
$pages = $postinfo[1];
$totalposts = $postinfo[0];
if ($startcounter > "-2"

echo "posts: $postcount <br> page: $pages <br> total: $totalposts<br> start: $startcount<br> end: $endcount <br>check: $check <br><br>";
if ($postcount==0) echo "No news is available!";
else
{
if (empty($startcount))
{
for($i=1; $i < $pages + 1; $i++)
{
if (!empty($posts[$i]))
{
//"/home/error-pr/public_html/test/news/$posts[$i]"
include trim($posts[$i]); echo "<br><br><br>";
}
else
{
exit;
}
}
$startcount = $pages+1;
$endcount = $startcount+$pages-1;
echo "<a href='news.php?startcount=$startcount&endcount=$endcount'>next</a>";
}
else
{
for($x=$startcount; $x <= $endcount; $x++)
{
if (!empty($posts[$x]))
{
include trim($posts[$x]); echo "<br><br><br>";
}
else
{
$xstart = $startcount-$pages;
$xend = $endcount-$pages;
echo "<a href='news.php?startcount=$xstart&endcount=$xend'>back</a>";
exit;
}
}
$xstart = $startcount-$pages;
$xend = $endcount-$pages;
if ($check="yes"

{
$startcount = $endcount+1;
$endcount = $startcount+$pages-1;
echo "<a href='news.php?startcount=$xstart&endcount=$xend'>back</a> + <a href='news.php?startcount=$startcount&endcount=$endcount'>next</a>";
}
else
{
$startcount = $endcount+1;
$endcount = $startcount+$pages-1;
echo "<a href='news.php?startcount=$startcount&endcount=$endcount'>next</a>";
}
}
}
?>
its supposed to make it so the first page after it has been press back to.. form the next page that it wont have the back button leading it into the nothingness... i was thinking i should do it off the startcount or endcount and i have... and say the startcount is 1 and i do a check if it is <=1 and it will turn out false.. theni can crack it up to <=5 and it still sats its false... maybe someoen can look over he code and point out what im doing wrong :/ thanks!
in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?