help making this work (collect form data in txt file)

whithat1246

Lurker
Member
Joined
Threads
2
Posts
2
<?php
$file = fopen("test.txt", "a");
fwrite($file, "\t\t\t\t\t\t");
fwrite($file, "\r\n");
foreach($_POST as $key => $value){
fwrite($file, "\t\t\t\t\t\t");
fwrite($file, $key);
fwrite($file, "=");
fwrite($file, $value);
fwrite($file, "\r\n");
}
fwrite($file, "\r\n");
fwrite($file, "\t\t\t\t\t\t");
fclose($file);
?>

i tried different php scrips but the txt file is not being created.

<?php
extract($_REQUEST);
$file=fopen("test.txt","a");

fwrite($file,"name :");
fwrite($file, $username ."\n");
fwrite($file,"Email :");
fwrite($file, $email ."\n");
fwrite($file,"Password :");
fwrite($file, $password ."\n");
fclose($file);
?>
--------------------------------------------------------------------------------------------------
<?php
$email=$_GET["email"];
$password=$_GET["password"];

$f=fopen("info.txt","a");
fwrite($f,"username:".$email." password:")
?>
 
  • whithat1246
    Created
  • Last reply
  • 0
    Replies
  • 326
    Views
  • 1
    Participants
  • Participants list