Ciao ragazzi... utilizzo questo script per le newsletter... il problema ora è che il DB è cresciuto e sono a 3500 utenti...
Il difetto di questo script è che mi suddivide gli utenti in tante pagine (al momento 114) e quando devo inviare un messaggio a tutti, in pratica non lo invia in background, quindi contemporaneamente a tutti.... ma devo di volta in volta confermare ogni pagina...
vi allego lo script:
Codice PHP:
$resultat = mysql_query("select * from $utenti where ml=$ml");
$nrows = mysql_num_rows($resultat);
$nombre = ceil($nrows/$ininvio);

if ( ($debut + $ininvio) < $nrows) {
  $testo=stripslashes($testo);
  $testo=htmlentities($testo);
?>

<div>
<form action=<?echo $PHP_SELF;?> method="post">
  <font face=verdana size=1> INVIA PROSSIMI </font>
  <input type=hidden name="debut" value="<? echo ($debut $ininvio)?>">
  <input type=hidden name="ml" value="<? echo $ml;?>">
  <input type=hidden name="id" value="<? echo $id;?>">
<? if (!isset($idtmpl)){ ?>
  <input type=hidden name="oggetto" value="<? echo $oggetto;?>">
  <input type=hidden name="testo"   value="<? echo $testo;?>"> 
<? } else { ?>
  <input type=hidden name="idtmpl"   value="<? echo $idtmpl;?>"> 
<? ?>
  <input type=hidden name="mailformat" value="<? echo $mailformat;?>">

  <input type=image border=0 name="imageField"  src="<? echo $web.$sottocartella."/".$imgdir."/fleched.".$fimg?>">
  
  <?    $reg  "{[a-z]*}";
        
$body $testof;
        
//print "TESTOF=".$testof ;
        
while (ereg($reg$body$m)){
                
//ereg($reg, $body, $m);
                
$indice $m[0];
                
$indice substr($indice,1,strlen($indice)-2);
                
$pos=strpos($body,"{$m[0]}");
                
$testo.= substr($body,0,$pos);
                switch (
$indice){
                    case 
"email";
                    case 
"nomeutente";
                    case 
"data";
                    break;
                    default:
                        print 
"<input type=hidden name='$indice' value='".$_POST[$indice]."'>\n";
    
                }
                
                
$body=substr($body,$pos+strlen($indice)+2);
        } 
            
        
$reg  "{[a-z]*}";
        
$body $oggettof;
        
        while (
ereg($reg$body$m)){
                
//ereg($reg, $body, $m);
                
$indice $m[0];
                
$indice substr($indice,1,strlen($indice)-2);
                
$pos=strpos($body,"{$m[0]}");
                
$testo.= substr($body,0,$pos);
                switch (
$indice){
                    case 
"email";
                    case 
"nomeutente";
                    case 
"data";
                    break;
                    default:
                        print 
"<input type=hidden name='$indice' value='".$_POST[$indice]."'>\n";
    
                }
                
                
$body=substr($body,$pos+strlen($indice)+2);
            } 
        
            
            
?>
  
</form>
</div>

<? }else{ ?>

<CENTER><font face=verdana size=2>[B]INVIO TERMINATO ![/B]</font></CENTER>


<? ?>
questo è il pezzo dove credo vadano effettuate le modifiche, cmq vi allego anche il file per intero!

click

E il file invia.php

Invece nel file mod.php vorrei inserire anche un form di ricerca tra gli utenti del DB...