Results 1 to 2 of 2

Thread: Sending form using php

  1. #1
    Join Date
    Apr 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sending form using php

    Hey guys,
    Ive just created a form to send the contents to my email account. But, instead, I want to send it to a textfile on the server, so I can view it at a later date. I got told php is the best way, but cant figure out how to do it. Can anyone help? Cheers

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Try this as an example:

    Code:
    <?php
    
    $var = "test Variable";
    
    $filename = "text.txt";
    
    $fp = fopen($filename, w); //open the file
    fwrite($fp, $var); //write to the file
    fclose($fp); //close the file
    ?>
    This is just a basic framework for you, but should work with very little modification.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

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