Connecting Tech Pros Worldwide Forums | Help | Site Map

convert page to PDF or .xls or .doc and email as attachment

jsd219
Guest
 
Posts: n/a
#1: Nov 15 '07
I have a report.php page that displays data from a mysql database.

I would like to create a text box to input an email address and upon
submitting, have the report attached and sent to the email specified.
The page can be converted to PDF or .xls or .doc whichever is easier.

Does anyone know how to do this? first and foremost, convert the page
to a PDF or .xls or .doc and second set up the form to attached the
newly created file and send it to the address specified.

God bless
jason

Steve
Guest
 
Posts: n/a
#2: Nov 16 '07

re: convert page to PDF or .xls or .doc and email as attachment



"jsd219" <info@musiclanerecording.comwrote in message
news:e2c8bc46-2670-459c-9234-50d2f57a0dd1@o6g2000hsd.googlegroups.com...
Quote:
>I have a report.php page that displays data from a mysql database.
>
I would like to create a text box to input an email address and upon
submitting, have the report attached and sent to the email specified.
The page can be converted to PDF or .xls or .doc whichever is easier.
>
Does anyone know how to do this? first and foremost, convert the page
to a PDF or .xls or .doc and second set up the form to attached the
newly created file and send it to the address specified.
for excel, it's fairly easy (depending on the complexity of your output). if
you provide a callback function to ob_start(), you can build your normal
html - preferably a table. when the output buffer is ready to send the data
(to the browser for instance) it will give your function the content that's
about to be sent. at that point, you can just set the header() to the right
content-type. as for emailing that...just set the appropriate mime-type
content-type and put it in its correct boundry in the email.

for pdf, i use fpdf and build the output as i go. the same thing applies for
emailing...put it in the correct boundry and give it the correct
content-type.
Quote:
God bless
allah? mythra, zeus, jesus? too many to be meaningful...but i appreciate
your kindness. :)


Closed Thread