Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-07-2006, 06:11 PM   PM User | #1
crunkbbfe
New Coder

 
Join Date: Jan 2006
Location: California. USA
Posts: 86
Thanks: 1
Thanked 0 Times in 0 Posts
crunkbbfe is an unknown quantity at this point
form to text help

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" );
?>
crunkbbfe is offline   Reply With Quote
Old 01-07-2006, 06:17 PM   PM User | #2
Yusayoh
New Coder

 
Join Date: Jan 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Yusayoh is an unknown quantity at this point
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.
__________________
|||||||||||||||||||||||||||||||||
Yusayoh is offline   Reply With Quote
Old 01-07-2006, 07:27 PM   PM User | #3
arne
Registered User

 
Join Date: Sep 2005
Posts: 315
Thanks: 0
Thanked 0 Times in 0 Posts
arne is an unknown quantity at this point
how to => fwrite

PHP Code:
<?
//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

Last edited by arne; 01-07-2006 at 07:31 PM..
arne is offline   Reply With Quote
Old 01-07-2006, 10:01 PM   PM User | #4
Velox Letum
Senior Coder

 
Join Date: Apr 2005
Location: Colorado, United States
Posts: 1,208
Thanks: 0
Thanked 0 Times in 0 Posts
Velox Letum is an unknown quantity at this point
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.
__________________
"$question = ( to() ) ? be() : ~be();"
Velox Letum is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:06 AM.


Advertisement
Log in to turn off these ads.