Need a simple php and html script!?

  • Thread starter Thread starter Nishant B
  • Start date Start date
N

Nishant B

Guest
I needed a simple script ! A page where
they will ask the details like

Name
LastNAme
Email
Country

and when they enter all these details it should be saved in a

NOTEPAD file .txt ! which will be with that script in the server

Thanks
 
$filename = 'test.txt';
$content = $_POST('Name')."#".$_POST('LastNAme')."#".$_POST('Email')."#".$_POST('Country');
if (is_writable($filename))
{
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $content) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";

fclose($handle);

}
} else {
echo "The file $filename is not writable";
}
 
Back
Top