agradeço a todos

Posted 01/11/2003, 19:30
Posted 01/11/2003, 20:32
<?php
$num = rand (1,3) ; // gera um numero aleatorio entr 1 e 3 //
if($num==1){
echo"<img src='imgem1.gif'>" ;
}
elseif($num==2){
echo"<img src='imgem2.gif'>" ;
}
elseif($num==3){
echo"<img src='imgem3.gif'>" ;
} // assim vai indo
?>
Posted 01/11/2003, 20:43
<?
$numero = rand (1,3) ;
echo"<img src=\"imgem_$numero.gif\">" ;
?>
Posted 01/11/2003, 20:49
Posted 01/11/2003, 20:58
Posted 01/11/2003, 22:33
Posted 03/11/2003, 18:03
Posted 03/11/2003, 19:00
Posted 03/11/2003, 19:57
Posted 03/11/2003, 23:01
Posted 04/11/2003, 15:30
Posted 04/11/2003, 15:58
Posted 04/11/2003, 16:22
Posted 04/11/2003, 17:06
<? $sql = mysql_query("SELECT * FROM publicidade"); $quantidade = mysql_num_rows($sql); $num = rand(1,$quantidade); while ($valores = mysql_fetch_array($sql)) { $id = $valores["id"]; if ($num == $id) { echo "<img src='".$valores[banner]."'>"; } } ?>
Posted 08/11/2003, 21:27
Pessoal, estou com um problemão,Funcionou !!!! eu ate dei uma pequena configurada !!!!!
<? $sql = mysql_query("SELECT * FROM publicidade"); $quantidade = mysql_num_rows($sql); $num = rand(1,$quantidade); while ($valores = mysql_fetch_array($sql)) { $id = $valores["id"]; if ($num == $id) { echo "<img src='".$valores[banner]."'>"; } } ?>
bom falow !!!
$num = rand(1,$quantidade);Só conseguirei explicar dando um exemplo:
Edição feita por: X4ND4O/RP, 08/11/2003, 21:32.
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)