ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Fateyev Grigory <greg@anastasia.ru>
To: community@altlinux.ru <community@altlinux.ru>
Subject: [Comm] вопрос по PHP
Date: Sat, 26 Jun 2004 18:21:50 +0400
Message-ID: <20040626182150.4e3d9045.greg@anastasia.ru> (raw)

Здравствуйте!

Помогите понять где ошибся?
Скрипт читает каталог с фалами и выводит их по двадцать и формируются
ссылки 1 2 3 4 5 и т.д., выводит первую страницу и при нажатии на
следущие, выводятся опять первые 20 фотографий. 
По моему проблема в "for ($i=0; $i<$fotos_per_page; $i++)"? Но что не
так, я не понимаю.

if ($handle = @opendir("small")){
while (false !== ($file = readdir($handle))) 
 if ($file != "." && $file != "..") $filesarr[] = trim($file);
 $fotos_per_page = 20;
$total_pages = ceil(count($filesarr)/$fotos_per_page);
 if (($_GET['from']<1) || ($_GET['from']>$total_pages)) $_GET['from']=1;
for ($i=0; $i<$fotos_per_page; $i++)
 {
 echo "<img src='small/".$filesarr[$i]."' border=0><br><br>\n";
}
 for ($i=0; $i<$total_pages; $i++)
{
 if ($i==$_GET['from']) echo " $i ";
else echo " <a href='?from=".($i+1)."'>".($i+1)."</a> ";
 }
closedir($handle);
}

Спасибо!

-- 
Всего наилучшего!
greg@anastasia.ru Григорий.



             reply	other threads:[~2004-06-26 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-26 14:21 Fateyev Grigory [this message]
2004-06-27 21:18 ` Евгений Миленченко
2004-06-28 15:18   ` Fateyev Grigory
2004-06-29  3:44     ` Re[2]: " php-coder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040626182150.4e3d9045.greg@anastasia.ru \
    --to=greg@anastasia.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git