listar em ordem por nome
aew pessoal tenho esse codigo ele esta listando tudo fora da orde queria fazer com que ele listasse em ordem ASC ow seja por nome
sera que alguem poderia me ajudar?
PHP
[*]<?
[*]if (strstr($pg,".")== TRUE){
[*]$pg=ceil($pg);
[*]$pg=$pg-1;
[*]}
[*]if (!$pg==0)
[*]{
[]$cont=$pg 12;
[*]} else {
[*]$cont=0;
[*]}
[*]?>
[*]<? include("path.php");?>
[*]<head>
[*]<link rel="stylesheet" type="text/css" href="estilo.css">
[*]</head>
[*]<body bgcolor="#999999" text="#FF9900" link="#FF9900" vlink="#FF9900" alink="#FF9900" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
[*]<table border="0" align="" cellpadding="0" cellspacing="0" bordercolor="#225894" bgcolor="#225894">
[*] <tr>
[*] <td width="342" height="348" align="center" valign="top" bgcolor="#999999">
[*] <?
[*]$handle = opendir($dir);
[*]$ext = "jpg";
[*]$indice = 0;
[*]$ipp = 12;
[*]
[*]while (false !== ($file = readdir($handle)))
[*]{
[*] $pathdata = pathinfo($file);
[*] if (!is_dir($file) && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext)))
[*] {
[*] $imagens[$indice] = $file;
[*] $indice++;
[*] }
[*]}
[*]
[*]$pagina = 1;
[*]if ($_GET['pg'])
[*] $pagina = $_GET['pg'];
[*]
[*]$paginas = ceil(count($imagens) / $ipp);
[*]$inicio = $pg * $ipp;
[*]$thumb="imagemdim.php?imagem=";
[*]$var1 = "&evento=$evento&data=$data&local=$local";
[*]
[*]for ($i=$inicio; $i<($inicio+$ipp); $i++)
[*]if($imagens[$i] != ""){ ?>
[*] <? $cont=$cont+1; ?>
[*] <a href="zoom.php?dir=<? echo "$dir";?><? echo $var1?>&pg=<? echo "$cont";?>" target="exibe_foto">
[*] </a> <a href="zoom.php?dir=<? echo "$dir";?><? echo $var1?>&pg=<? echo "$cont";?>" target="exibe_foto"><img src="<? echo "$thumb$dir$imagens[$i]"; ?>" border="1"></a>
[*] <? }?>
[*] </td>
[*] </tr>
[*] <tr>
[*] <td width="342" align="center" valign="top" bgcolor="#999999"> <font color="#FFFFFF" size="2" face="verdana">
[*] <?
[*]for($i=0; $i<$paginas; $i++){
[*]$url = "?dir=$dir&pg=$i";
[*] if ($i==$pg) {
[*] echo " <b>".($i+1)."</b> ";
[*] } else {
[*] echo " <b><a href='$url'>".($i+1)."</a> </b>";
[*] }
[*]}
[*]?>
[*] </font></td>
[*] </tr>
[*]</table>
[*]</body>
boa noite aew pra todos
falow comunidade
ate +
quem poder me ajudar eu agradeço http://forum.imasters.com.br/public/style_emoticons/default/joia.gif
Discussão (11)
Carregando comentários...