View Full Version : form to text help
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( "firstname.lastname@example.org", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.freespaces.com/bbfe/myspace/myspace.html" );
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.
//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");
DON'T FORGET TO CHMOD FILE.TXT TO 777
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.