ciao a tutti, ho la necessità di generare una pagina html partendo dai dati presenti in un DB
premetto che sono riouscito a "stampare" a schermo i dati presenti in un database con questo codice

Codice PHP:
<? include("conn.php"); ?>
        
    <?php
        $Risultato
=mysql_query("select * from iscrizione"$conn);
        if (!
$Risultato)
        {
            die(
"La tabella selezionata non esiste " mysql_error());
        }

        while (
$riga=mysql_fetch_array($Risultato))
        {
        echo 
"<div>" $riga[4] . "</div></div>"
        
;
        }
    
?>
questo è il file conn.php

Codice PHP:

<?php
    $conn
=mysql_connect("62.149.xxx.xxx""Sqlxxxxxx""767xxxx");
    if (!
$conn)
    {
        die(
"Connessione a Mysql non riuscita " mysql_error());
    }
    
    
$db=mysql_select_db("Sql3xxxxx_1"$conn);
    if (!
$db)
    {
        die(
"Connessione al Database non riuscita " mysql_error());
    }    
?>
ora a me servirebbe che aprendo una pagina php mi genri un file html ( es newsletter.html ) e cge aprendo la pagina php la volta successiva mi sovvrascriva il file html creato in precendenza. mi servirebbe anche sapere in che parte di codice devo mettere linguaggio html creato in precedenza.
se vi state chiedendo perchè ho bisogno di una pagina html e non posso usare la pagina php che stampa a schermo i dati è perchè poi questo file html lo mando come email html. se invece sapete come fare a mandare un email in formato html prelevadno i dati da database sarebbe ancora meglio.
io per inviare le email html uso questo script:

Codice PHP:
 <?php
// read the list of emails from the file.
$email_list file("elist.txt");
 
// count how many emails there are.
$total_emails count($email_list);
 
// go through the list and trim off the newline character.
for ($counter=0$counter<$total_emails$counter++) {
   
$email_list[$counter] = trim($email_list[$counter]);
   }
 
// implode the list into a single variable, put commas in, apply as $to value.
$to implode(",",$email_list);

$subject "BOLLETTINO Angeli per un giorno";
$message "<html><body>

ciao questa è una prova di invio.</p>


 grazie</p>

</body></html>"
;
$headers  'From: [email]bollettino@anxxxxxxxxxx.it.it[/email]' "\r\n";
$headers .= 'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

if ( 
mail($to,$subject,$message,$headers) ) {
   echo 
"The email has been sent!";
   } else {
   echo 
"The email has failed!";
   }
?>
grazie infinite a tutti quanti