...

View Full Version : form to text help



crunkbbfe
01-07-2006, 06:11 PM
ok i have this script and it works excellently to send me emails but how do i change it to just put it into a .txt on my server?


<?


$email = $_REQUEST['email'] ;
$message = $_REQUEST['name'] ;
mail( "someone@msn.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.freespaces.com/bbfe/myspace/myspace.html" );
?>

Yusayoh
01-07-2006, 06:17 PM
Learn fwrite, fopen, fclose. You have to have an already-made txt file like file.txt. I forget which file you have to CHmod to 777 though. fopen = opens file; fclose = closes file; and fwrite = writes to file.

arne
01-07-2006, 07:27 PM
<?
//I hope this helps

$message = put here what you want to write into the file.txt (or if you use the script you posted you can just not define message anymore cause you already used that as $var !

$file_name1 = "map/file.txt";

$file_pointer1 = fopen("$file_name1", "a");

fwrite($file_pointer1, "$message");

fclose($file_pointer1);
?>


DON'T FORGET TO CHMOD FILE.TXT TO 777

Velox Letum
01-07-2006, 10:01 PM
It really only needs 766 or 666, but as its a text file, 777 works fine. 766 would be read/write/execute for owner, read/write for group, and read/write for others.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum