$var[rand(0,(count($var) -1))]Eu arrumei um tempo pra ler o manual e rand() tem um indice de repetição muito grande isso significa que ele repete muito por algum motivo esta repetição está levando ao problema.
Falopa!
Posted 01/02/2007, 22:12
$var[rand(0,(count($var) -1))]Eu arrumei um tempo pra ler o manual e rand() tem um indice de repetição muito grande isso significa que ele repete muito por algum motivo esta repetição está levando ao problema.
Posted 02/02/2007, 08:51
Tenta assim
$var[rand(0,(count($var) -1))]Eu arrumei um tempo pra ler o manual e rand() tem um indice de repetição muito grande isso significa que ele repete muito por algum motivo esta repetição está levando ao problema.
Falopa!
Note que readdir() irá retornar o . e .. . Se você não quer estes simplesmente os retire:
Exemplo 2. Listar todos os arquivos no diretório atual e retirar . e ..
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handle);
}
?>
Posted 02/02/2007, 09:03
if (file_exists($file)) { echo "$file\n"; }desta forma você verifica se é um arquivo se for ele mostra se não for não mostra
Posted 12/02/2007, 08:24
<? include("config.php"); $id = $_GET[id]; $sql = mysql_query("SELECT * FROM galeria where id='$id'"); $dados= mysql_fetch_array($sql); $dir = "../../images/picture/$dados[pasta]/"; ?> <script src="janelas_popup.js" language="JavaScript"></script> <? if(!isset($page) ){ $page=1; } //$handle = opendir($dir); $ext = "jpg"; $indice = 2; $ipp = 1; //while (false !== ($file = readdir($handle))) { $pathdata = pathinfo($file); if (!is_dir($file) && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext))) { $imagens[$indice] = $file; $indice++; } } //natcasesort($imagens); //reset($imagens); $pagina = 1; if ($_GET['page']) $pagina = $_GET['page']; $paginas = ceil(count($imagens) / $ipp); $total = ceil(count($imagens)); $inicio = $page * $ipp; for ($i = $inicio; $i < ($inicio + $ipp); $i++) //$thumb="thumbs.php?w=320&h=240&imagem="; //sem a logo $thumb="thumbs.php?w=320&h=240&imagem="; //com a logo ?> <table width="320" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="67%">Nome: <b><? echo "$dados[nome]";?></b></td> <td width="33%" align="right">Data: <b><? $data = explode("-", $dados[data]); echo "$data[2]/$data[1]/$data[0]";?></b></td> </tr> </table> </td> </tr> <tr> <td valign="top"> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="320" style="border:1px solid #999999;" height="242" align="center" valign="middle" background="images/img_carregando.gif"> <img src="<? echo "$thumb$dir$imagens[$i]";?>" border="0"></td> </tr></table> </td> </tr><tr> <TD align="center" valign="middle"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr align="center"> <td><img src="images/bt_vo.gif" width="53" height="16"></td> <td><a href="java script:indica('<? echo "indicacao.php?id=$id&imagem=$imagens[$i]";?>');"><img src="images/bt_en.gif" width="53" height="16" border="0"></a></td> <td> </td> <td><a href="java script:imprimi('imprimir.php?imagem=<? echo "$dir$imagens[$i]";?><? echo $var1?>');"><img src="images/bt_im.gif" width="53" height="16" border="0"></a></td> <td><a href="java script:AddAlbum('<? echo "../usuarios_vip/add_album_form.php?id=$id&imagem=$imagens[$i]";?>');"><img src="images/bt_av.gif" width="53" height="16" border="0"></a> </td> </tr> </table></td> </tr> </table>
Posted 02/03/2007, 02:34
Posted 02/03/2007, 08:41
Posted 02/03/2007, 11:57
Posted 02/03/2007, 21:17
Bem Ja consegui fazer a minha funcionar quem quizer dar uma olhada http://www.osinvasores.k6.com.br/
Precisei dar umas misturadas nas versões anteriores pra ficar ao meu gosto mais ficou muito boa
valew a todos pela ajuda.
Posted 04/03/2007, 17:03
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@portalcobras.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Posted 08/03/2007, 10:51
Posted 08/03/2007, 11:12
Posted 10/03/2007, 18:15
Edição feita por: jamsbboy, 10/03/2007, 18:52.
Posted 22/03/2007, 17:40
Posted 23/03/2007, 11:39
Edição feita por: MaToX, 23/03/2007, 13:15.
Posted 02/04/2007, 22:51
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)