Ok, ho fatto nel seguente modo:
In questo modo il FILEDAMODIFICARE.html mi viene aperto all'interno del form che, a sua volta, tramite lo script contenuto in MODIFICAFILE.php...codice:<table width="300" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="50">File:</td> <td width="250"> <form action=aprifile.php method=post> <textarea name=NOMEFILE cols="30"> </textarea><input type='submit' value='modifica'> </form> </td> </tr> <tr> <td></td> <td width="250"><?php $html = file_get_contents($_POST['NOMEFILE']); echo "<form action='MODIFICAFILE.php' method='post'> <table><tr><td> <textarea name='text' cols='80' rows='15'>$html</textarea> </td></tr></table> <input type='submit' value='invia'> </form>"; ?></td> </tr> </table>
...mi permette di fare delle variazioni e salvarle nel file FILEMODIFICATO.html, che non è esattamente ciò che voglio. In pratica vorrei che la variabile $filename mi riprenda in automatico il FILEDAMODIFICARE.html, dandogli lo stesso nome d'origine, anziché rinominandolo FILEMODIFICATO.html, che è fisso.codice:<?php $filename = "FILEMODIFICATO.html"; $testo= (get_magic_quotes_gpc()) ? stripslashes($_POST['text']) : $_POST['text']; $handle = fopen($filename, 'w'); fwrite($handle, $testo); fclose($handle); include('aprifile.php'); ?>
Potreste darmi una mano?
Grazie.

Rispondi quotando