473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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?
Oct 24 '06 #1
5 2756
ronverdonk
4,258 Expert 4TB
You can send the file with your email message as an attachment.

Ronald :cool:
Oct 24 '06 #2
And how do I do that? I'm sorry - I'm new at this!
Oct 24 '06 #3
ronverdonk
4,258 Expert 4TB
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:
Oct 24 '06 #4
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 $ManagerRoomNumber \n
I9 on file?: \t $I9\n
Year of Graduation: \t $YearofGraduation \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);


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:
Oct 24 '06 #5
ronverdonk
4,258 Expert 4TB
Why don't you just do what was asked and
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:
Oct 24 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David Thomas | last post by:
Hi there, I am trying to store data in a text file and output it to the browser using PHP. All very easy - if I was using English! the problem is, I want to use Japanese and I'm finding it a tad...
16
by: Chuck Amadi | last post by:
Sorry to bovver you again (again) here's script. I still can't see why the get_payload() doesn't produce the plain text message body of an emails in the testwwws users mailbox. As you can see I...
0
by: John M. Lembo | last post by:
I am using Perl to parse a text file and output to another file. The text file has data on Unix virtual memory (vmstat) and I want to delete lines that I don't want and output lines that I want to...
2
by: Oleg Ogurok | last post by:
Hi all, On my web page, I have a <OBJECT DATA="mydatafile.ica" ...> which loads Citrix ICA web client. The problem is that I want to generate the mydatafile.ica on the fly (e.g. based on...
3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
3
by: Blankdraw | last post by:
I'm getting NO errors and 2 warnings with this code. I thought I was ready to write the output-formatting segment, but may be way off the mark now. The warnings say that "OPEN() and READ() are...
1
by: Aalok | last post by:
This is what i want to do. Read a text file as an input and based on that file, Create an outpu text file which saves the contents of the input file in a specifi format in the output file. I...
12
by: vj | last post by:
I am using Borland C++. I run a program which generates output data files, say 'Voltage.dat', 'Current.dat'. I have a variable in my code (say N), and for various values of N (for each value of...
1
by: dwaterpolo | last post by:
Hi Everyone, I am trying to read two text files swY40p10t3ctw45.col.txt and solution.txt and compare them, the first text file has a bunch of values listed like: y y y y y y y
13
by: jhamb | last post by:
Hi, This code is in Perl (just a trial, not tested) to parse a text file and output to another file. It is used to delete lines that are not required and output lines that the user wants, to a new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.