convert page to PDF or .xls or .doc and email as attachment
am 15.11.2007 22:51:04 von jsd219
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
Re: convert page to PDF or .xls or .doc and email as attachment
am 16.11.2007 15:10:10 von Steve
"jsd219" wrote in message
news:e2c8bc46-2670-459c-9234-50d2f57a0dd1@o6g2000hsd.googleg roups.com...
>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.
> God bless
allah? mythra, zeus, jesus? too many to be meaningful...but i appreciate
your kindness. :)