Create una pagina html con due form ecco una pagina completa :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta http-equiv="Content-Language" content="it" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
My Editor One Vers. 0.0.1
</title>
<link rel="stylesheet" type="text/css" href="stile.css" />
<meta name="GENERATOR" content="GNU/Emacs and my mind..." />
</head>
<body>
<div id="content">
<h1>Online Editor V.1</h1>
<form method="post" action="scrivi.php">
<label for="nome">Nome del file</label>
<input type="text" name="nome" id="nome" class="txt" maxlength="24" />
<br />
<textarea name="messaggio" id="messaggio" class="txtA" rows="30" cols="40">
</textarea>
</p>
<p>
<input type="submit" name="sub" id="sub" value="Salva" class="btn" />
<input type="reset" value="Annulla" name="res" id="res" class="btn" />
</p>
</form>
<br />
<form method="post" action="leggi.php">
<label for="nome">Nome del file </label>
<input type="text" name="nome" id="nome" class="txt" maxlength="24" />
<br />
<input type="submit" name="sub" id="sub" value="Leggi" class="btn" />
<input type="reset" value="Annulla" name="res" id="res" class="btn" />
</form>
</div>
</body>
</html>
Ecco qui il codice di leggi.php :
<?php
$data = (date("d-m-y"));
$ora = (date("G:i"));
$oggetto = "Email inviata da Robot Editor";
$mail = "_______@gmail.com";
$okInvio = "Email inviata da Robot Editor il ".$data." alle ".$ora." - Inizio del messaggio - \n";
$okInvio .= "E' stato scritto un file con nome " . $nome;
mail($mail, $oggetto, $okInvio);
$identificatore = fopen($nome, "a");
fwrite($identificatore, $messaggio);
fclose($identificatore);
header("location: edit.php");
?>
notare che spedisce un'email per notificare la scrittura di un file
E qui il file leggi.php:
<?php
$identificatore=fopen ($nome, "r");
while (!feof ($identificatore)){
$buffer=fgets($identificatore, 4096);
echo "$buffer
";
}
echo "Ultimato";
fclose ($identificatore);
?>
Utilità ? Nessuna ma uno spunto per fare qualcosa di più grande
Segnali forex - dritte - analisi - commenti
Pagine
venerdì 12 febbraio 2010
Iscriviti a:
Commenti sul post (Atom)
Archivio blog
-
▼
2010
(53)
-
▼
febbraio
(12)
- Cross CADJPY
- Cross AUD CAD
- Forex CROSS AUDCAD e CADJPY
- Croos EUR/AUD
- Stima per il CROSS CAD JPY
- Stima per il cross CAD JPY
- Cross AUD EUR
- >Un programma d'affiliazione che funziona davvero
- Un editor di testo ONLINE in PHP
- Internet e i bambini
- IL SUCCESSO TI STA ASPETTANDO ... NON TI NASCONDERE!
- Buttandomi sul CROSS GBP /USD
-
▼
febbraio
(12)
Nessun commento:
Posta un commento
...