Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2006
    Location
    California. USA
    Posts
    86
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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" );
    ?>

  • #2
    New Coder
    Join Date
    Jan 2006
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    |||||||||||||||||||||||||||||||||

  • #3
    Registered User
    Join Date
    Sep 2005
    Posts
    315
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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 08:31 PM.

  • #4
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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();"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •