- fclose: documentation ( source)
- feof: documentation ( source)
- fgets: documentation ( source)
- fwrite: documentation ( source)
- fopen: documentation ( source)
<?php
if(isset($_POST["submit"])){
if($_POST['formsend']==0){
if($_POST["user"]!="" && $_POST["email"]!="" && $_POST["message"]!=""){
$file=fopen("database.txt","a+");
fwrite($file,$_POST["user"]." ".$_POST["email"]." ".$POST["message"]."\r\n");
fclose($file);
}
}
}
?>
<?php
$file1=fopen("database.txt","r");
while(!feof($file1))
{
echo fgets($file1). "<br> ";
}
fclose($file1);
?>