Output PHP data to text file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goosebriar
    New Member
    • Oct 2006
    • 3

    Output PHP data to text file?

    I currently have an html form that sends data to a PHP file which then sends it by e-mail to me. Is there anyway to have the PHP file e-mail an xml or csv file so that I can import it right into a database?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You can send the file with your email message as an attachment.

    Ronald :cool:

    Comment

    • goosebriar
      New Member
      • Oct 2006
      • 3

      #3
      And how do I do that? I'm sorry - I'm new at this!

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Show the email code you are using now. We'll start from there. And put that code BETWEEN [php] and [/ php] TAGS. (See the reply guidelines at the right of the answer message area).

        Ronald :cool:

        Comment

        • goosebriar
          New Member
          • Oct 2006
          • 3

          #5
          Here is the e-mail code (I ex'ed out my email address):

          $to = 'xxxxxx@xxx.com ';
          $subject = 'Student Employment Information';
          $message = "Date Submitted: \t $DateSubmitted\ n
          Name: \t $firstName $lastName \n
          Address1: \t $address1 \n
          Address2: \t $address2 \n
          City, State, Zip: \t $city, $state, $zip \n
          Student ID: \t $id \n
          Phone: \t $phone \n
          email: \t $email \n
          Start Date: \t $StartDate \n
          Manager: \t $Manager \n
          Manager Phone: \t $ManagerPhone \n
          Manager e-mail: \t $ManagerEmail \n
          Room Number: \t $ManagerRoomNum ber \n
          I9 on file?: \t $I9\n
          Year of Graduation: \t $YearofGraduati on \n
          Federal Work Study?: \t $WorkStudy \n
          Academic Status: \t $Status \n
          Job Number: \t $JobNumber \n
          Account Number: \t $AccountNumber \n
          Current Payrate: \t $CurrentPayrate ";


          $headers = 'From: xxxx@xxx.com' . "\r\n" .
          'X-Mailer: PHP/' . phpversion();


          mail($to, $subject, $message, $headers);


          Originally posted by ronverdonk
          Show the email code you are using now. We'll start from there. And put that code BETWEEN [php] and [/ php] TAGS. (See the reply guidelines at the right of the answer message area).

          Ronald :cool:

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            Why don't you just do what was asked and
            Originally posted by ronverdonk
            put that code BETWEEN [php] and [/ php] TAGS. (See the reply guidelines at the right of the answer message area).
            or read the Posting Guidelines at the top of this forum about mandatory usage of tags with code.

            Ronald :cool:

            Comment

            Working...