Newsgroup: it.comp.www.php
Titolo: Un simpatico random.. !!! !! !! !

Ciao a tutti, guardate questa...
recupero tutti i risultati da una query (cerco dei nomi in una rubrica)
e poi inizio il procedimeto che dovrebbe scegliere 9 nomi a caso tra
tutti i risultati recuperati..
il problema é che aggiorno la pagina 1,2 volte tutto OK poi continuo per
un pò per vedere risultati sempre diversi e mi trovo con gli stessi nomi
ad ogni pagina caricata..
qual'é il problema??
$sqlconn= @mysql_connect ($dbhost,$dbutente,$dbpass);
@mysql_select_db ($database, $sqlconn);
$query= @mysql_query("SELECT nick FROM $tabella2");
$cnt=0;
while ($row = mysql_fetch_array($query))  
{
    $input[$cnt++] = $row[0];
}
mt_srand((double)microtime()*10000000);
$rand_keys = array_rand ($input, 9);
?>
<table border="0" cellspacing="10" cellpadding="0">
<tr align="center" valign="middle"> 
<td><?  print $input[$rand_keys[0]];  ?></td>
<td><?  print $input[$rand_keys[1]];  ?></td>
<td><?  print $input[$rand_keys[2]];  ?></td>
<td><?  print $input[$rand_keys[3]];  ?></td>
<td><?  print $input[$rand_keys[4]];  ?></td>
<td><?  print $input[$rand_keys[5]];  ?></td>
<td><?  print $input[$rand_keys[6]];  ?></td>
<td><?  print $input[$rand_keys[7]];  ?></td>
<td><?  print $input[$rand_keys[8]];  ?></td>
</tr>
</table>

 ha scritto nel messaggio
news:1f08kiu.bi95uk1f5c1bgN%thomas...@inwind.it...


 veramente la pagina.
per essere sicuro che ricarica la pagina premi CTRL+F5 !!!!
ciao

 ciao
 
Seeeeeeeeeeeeeeee! :-))
Ciao
--ev che 'dajie dajie di no-cache'! 

Ho provato ma non funziona ancora..
scusate l'ignoranza ma come dovrei usare esattamente l'header:
<?
header ("Pragma: no-cache");
?>
what is "pragma"?
grazie ancora..

riposto..


  what is "pragma"?
14.32 Pragma
   The Pragma general-header field is used to include implementation-
   specific directives that may apply to any recipient along the
   request/response chain. All pragma directives specify optional
   behavior from the viewpoint of the protocol; however, some systems
   MAY require that behavior be consistent with the directives.
          Pragma            = "Pragma" ":" 1#pragma-directive
          pragma-directive  = "no-cache" | extension-pragma
          extension-pragma  = token [ "=" ( token | quoted-string ) ]
   When the no-cache directive is present in a request message, an
   application SHOULD forward the request toward the origin server even
   if it has a cached copy of what is being requested. This pragma
   directive has the same semantics as the no-cache cache-directive (see
   section 14.9) and is defined here for backwards compatibility with
   HTTP/1.0.  Clients SHOULD include both header fields when a no-cache
   request is sent to a server not known to be HTTP/1.1 compliant.
   Pragma directives MUST be passed through by a proxy or gateway
   application, regardless of their significance to that application,
   since the directives may be applicable to all recipients along the
   request/response chain. It is not possible to specify a pragma for a
   specific recipient; however, any pragma directive not relevant to a
   recipient SHOULD be ignored by that recipient.
   HTTP/1.1 clients SHOULD NOT send the Pragma request-header. HTTP/1.1
   caches SHOULD treat "Pragma: no-cache" as if the client had sent
   "Cache-Control: no-cache". No new Pragma directives will be defined
   in HTTP.
LAMASE