Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Guest book - zmiana skryptu!
Forum PHP.pl > Forum > PHP
Kaczor.net
Mam taki o to skrypcik i chciałbym by ktoś mi go tak przerobił by na jednej stronce pokazywane było 20 wpisów a do reszty były linki: 1 - 2 - 3. Z góry dziękuje.

[php:1:e9198b9c85]<?php

if (($REQUEST_METHOD=='POST'))
{
// ********** Date Stamp
$datestamp = date("d.m.Y");
$fpn=@fopen("dane.txt","a+");
@flock ($fpn,2);

// ********** IP Checking
$ipentry = $REMOTE_ADDR;

// ********** Remove HTML tags
$txtcomments = ereg_replace("<","&",$txtcomments);
$txtcomments = ereg_replace(">","&",$txtcomments);

// ********** Remove HTML
$txtname = strip_tags($txtname);
$txtname = StripSlashes($txtname);
$txtemail= strip_tags($txtemail);

// ********** Remove back slashes
$txtcomments = stripslashes($txtcomments);

// ********** Allow line breaks
$txtcomments = ereg_replace("(rn|n|r)", "<br />",$txtcomments);

// ********** Output
$rec = "<center><table border="0" cellpadding="1" cellspacing="1" bordercolor="#000000" width="350"><tr><td width="75" align="right"><font class="nagłówek">Nick:</font></td><td width="200"><a href="mailto:$txtemail">$txtname</td><td width="75"></td></tr><tr><td width="75" align="right"><font class="nagłówek">WWW:</font></td><td width="200"><a href="http://$txtwebsite" target="_blank">$txtwebsite</a></td><td width="75"></td></tr><tr><td width="75" align="right"><font class="nagłówek">Data:</font></td><td width="200">$datestamp</td><td width="75"></td></tr><tr><td width="75" align="right"><font class="nagłówek">IP:</font></td><td width="200">$ipentry</td><td width="75"></td></tr><tr><td colspan="3" width="350" valign="top"><br>$txtcomments</td></tr><tr><td colspan="3" width="350" colspan="2"><hr size="1" color class="nagłówek"></td></tr></table></center>". "n";

$fw=fwrite($fpn,$rec);
@flock($fpn,3);
@fclose($fpn);

}

$fp=@fopen("dane.txt","r"); // r = read
@flock ($fp,2);
$arrr=array();

while ($line=@fgets($fp,4096))
{
array_push($arrr,$line);
}

$totalent=count($arrr);

if ($totalent<0)
{
$totalent=0;
}

print "<center><a href="dodaj.php">Dodaj swój wpis</a></center><br>";
print "<center>Mam już $totalent fajnych wpisów.</center><br><br>";

if (count($arrr)==0)
{
print "<center>Brak wpisów</center>";
}

$ar=array_reverse($arrr);
$arrr=array();

$highlimit=$totalent;
for($i=0;$i<=$highlimit;$i++)
{
if (!$ar[$i])
{
}

print "$ar[$i]";

}

@flock($fp,3);
@fclose($fp);

?>[/php:1:e9198b9c85]
scanner
To nie jest temat na PRO.
Poszukaj na forum o stronicowaniu wyników.
DeyV
forum zazwyczaj służy do tego, by sie czegoś nauczyć.
Do zleceń również jest forum, ale nazywa się ... praca oferowana
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.