Emmebar, grazie della solerte risposta! Giusto in tempo che avevo finito i popcorn!
Si io ed il php abbiamo leticato da piccini...
Quote:
|
Deve scrivere una pagina html ed usare per farlo le informazioni che tu dai tramite il form ?
|
Si esatto,deve scrivere questo file html usando le informazioni dei campi del form. Quando queste informazioni vengono "prese" dai campi del form, lo script php dovrebbe creare il file html e piazzare gli elementi nei campi nelle apposite linee di testo del file html.
Esempio:
Mettiamo che tu abbia un file html semplice che aperto in un visualizzatore cosi' come e' appaia cosi'
Nome:
Cognome:
Citta':
Altro...:
Questo codice html inserito nello script php che prende le info dal form "post" dara' (ipotesi) la seguente pagina html da scaricare e salvare sul computer:
Nome: Mario
Cognome: Rossi
Citta': Castellammare Sabaudia
Altro...: Mi piace la bottarga!
Le info Mario, Rossi, ecc. sono quelle inserite nei campi del form "post".
Scusa, ho la testa a pinolo, mi sono sbagliato, ho postato il codice php vecchio. Mi era gia stato detto il fatto del backslash e lo avevo corretto.
Riposto il corretto!!!
codice:
<HTML>
<HEAD>
<TITLE>Voucher fatto</TITLE>
</HEAD>
<BODY>
<?
$file=fopen("voucher.html","a+");
fwrite($file, "<html>
<head>
<title></title
</head>
<body>
<table id=\"frame\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<TD id=\"header\" valign=\"top\" align=\"right\">
<p><h4>Portal To Your Wishes</h4></p>
</div></td>
</tr>
</table>
<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<TD id=\"leftcol\" valign=\"top\" align=\"left\">
<h1></h1>
<p><img src=\"../HTML_EMAIL/finestra.png\"></p>
</div></td><td> </td>
<TD id=\"content\" valign=\"top\" align=\"left\">
<h2><i>Booking Voucher</i></h2>
<p><div align=\"justify\">
Reservation Date: $reservation = $_POST['reservation'];
<br><br>Client Name: $name = $_POST['name'];
<br><br>Client Email:$email = $_POST['email'];
<br><br>Client Country: $country = $_POST['country'];
<br><br>Adults: $adults = $_POST['adults'];
<br><br>Children: $children = $_POST['children'];
<br><br>Nights Total: $nights = $_POST['nights'];
<br><br>Structure: $structure = $_POST['structure'];
<br><br>Arrival Date: $checkin = $_POST['checkin'];
<br><br>Time of Arrival: between 4 p.m. and 8,00 p.m.
<br><br>Departure Date: $checkout = $_POST['checkout'];
<br><br>Time of Departure: Not later than 10 a.m.
</div></p>
</div></td>
<TD id=\"rightcol\" valign=\"top\" align=\"left\">
</div></td>
</tr>
</table>
<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<TD id=\"footer\" align=\"center\" valign=\"middle\">
<p></p>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>");
include("voucher.html");
?>
</BODY>
</HTML> L'errore che mi da' e':
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\program files\easyphp1-8\www\submit_custom.php on line 49"
Volevo anche aggiungere che togliendo le string con $_POST funziona....non me lo fa scaricare, ma lo crea....
Non ti preoccupare di rispondere all'istante.... sta cosa mi preme parecchio, ma goditi il fine settimana!
Grazie davvero..
