I am fairly new to PHP still learning the language. Is it possible to have a user fill out a form on the web and have it save as a PDF file, then have the PDF file get sent to an e-mail address or something similar to that? I have a client we just finished a website on that would like to see something along this lines. The reason is so the user on my clients website can fill out a form and have it saved as a PDF to print for themselves. Then have that same info sent as the same PDF to the owner of the site via e-mail. Maybe click on a link to open it. Anyone let me know if this has ever been done before in PHP or if it is even feasible? Don’t have to do it this way but would try if was possible.
Yes I’ve done this before. Creating a PDF is pretty easy if you have a helper class like FPDF.
It has very good documentation, and is pretty easy to learn IMO.
Next, safe the generated PDF somewhere on the disk, and add is as an attachment to an e-mail (which is pretty easy if you use something like SwiftMailer or similar).
Once the mail has been sent delete the PDF from the disk (or keep it if you like), and you’re done
Yes just save it on the local hard disk temporarily so there is a file you can point SwiftMailer to. As far as I know you can’t give SwiftMailer a string and tell it to use that as attachment.