+ Reply to Thread
Results 1 to 8 of 8

Thread: Php Code Wanted! Payin 10 Pt.

  1. #1
    Brandon Guest

    Php Code Wanted! Payin 10 Pt.

    I need a php script that when run emails a .txt file to me with a subject line of my choosing and than clears the .txt file of any text.

  2. #2
    dsfreak's Avatar
    dsfreak is offline x10 Elder dsfreak is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Arizona, USA
    Posts
    669

    Re: Php Code Wanted! Payin 10 Pt.

    You want it to email you the .txt file, then delete the .txt file, while at the same time know what the subject line should be? Basicly, an automated email form, like then one on phpBB?

  3. #3
    Brandon Guest

    Re: Php Code Wanted! Payin 10 Pt.

    No. It emails me the .txt file with a subject line I want then clears out the .txt file to a blank one

  4. #4
    dsfreak's Avatar
    dsfreak is offline x10 Elder dsfreak is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Arizona, USA
    Posts
    669

    Re: Php Code Wanted! Payin 10 Pt.

    Ok. I got it now. I will try to make the PHP later tonight. Got chores now (damn). Will contact you later with the code.

  5. #5
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Php Code Wanted! Payin 10 Pt.

    Do it yourself. It's that hard. You need the help?

    You code do it in, I would think, 10 lines or less.

    http://php.net/fopen
    http://php.net/fread
    http://php.net/mail
    http://php.net/fwrite

    I could do it in... maybe 5-6. Whats the name of teh text file, your email address, and all that. I'll type it.
    Last edited by Bryon; 08-30-2005 at 10:13 PM.

  6. #6
    Brandon Guest

    Re: Php Code Wanted! Payin 10 Pt.

    I use to know how to do php

  7. #7
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Php Code Wanted! Payin 10 Pt.

    Wow I made a few mistakes in that other post of mine. I meant "It's not that hard", and "I could do it in 10 lines or less".

    PHP Code:
    <?php

    function readClearEmailFile($email$filename) {

       if (
    is_readable($filename)) {
          
    $content file_get_contents($filename);
              
    mail($email"File Contents"$content) or die("Error sending email.");
              
    $handle fopen($filename"w+");
              
    fclose($handle);
        } else {
          return 
    $filename .' is not readable.';
        }
       return 
    "File cleared, email sent successfully.";
    }

    ?>
    Make sure to chmod the file so it can be "read" by the script.
    Last edited by Bryon; 09-01-2005 at 12:35 AM.

  8. #8
    Bobswat is offline x10Hosting Member Bobswat is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Walton, NY
    Posts
    52

    Re: Php Code Wanted! Payin 10 Pt.

    yay NedreN is awesome
    -J.P.

+ Reply to Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. how can i convert Php pages and code into asp pages and code
    By n4tec in forum Scripts & 3rd Party Apps
    Replies: 11
    Last Post: 01-10-2009, 09:40 PM
  3. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-14-2008, 11:40 PM
  4. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  5. syntax highlighting for PHP code
    By dharmil in forum Graphics & Webdesign
    Replies: 1
    Last Post: 08-03-2006, 05:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers