generate html file by PHP script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cerkoxxl
Forum Newbie
Posts: 2
Joined: Tue Jan 10, 2012 8:52 am

generate html file by PHP script

Post by cerkoxxl »

Hi.
I am pretty new in PHP, I do more static HTML pages fom my self an for my friends.

I am using HTML form and PHP script to sent an email with data filled in form.

Now, I want to change PHP script to not sent data in mail body, but to save data to HTML file and then sent this HTML file as attachement. So the script should create HTML file with data form HTML form, save it on server and send the HTML file either as attachement or sent a link to this file on server. And of course, every file shoud be generated with unique name.

I spent days googling without any success. Do anybody have any idea, or know some page, where is written something more about this problem?

What I really need is to sent printable document to customer with data filled in HTML form all this by email. So if somebody have diffreent Idea as my, please, share it.

Thanks.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: generate html file by PHP script

Post by social_experiment »

http://www.php.net/manual/en/function.fwrite.php
Look at this url for advice on writing to a file
http://www.texelate.co.uk/blog/send-ema ... -with-php/
This url is about sending an attachment using php's mail() function.

Hth
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
cerkoxxl
Forum Newbie
Posts: 2
Joined: Tue Jan 10, 2012 8:52 am

Re: generate html file by PHP script

Post by cerkoxxl »

Thanks for your advise. I will try it.
Post Reply