13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

784 Chapter 32 Generating Personalized Documents in Portable Document Format (PDF)<br />

Listing 32.2<br />

}<br />

?><br />

}<br />

Continued<br />

";<br />

This script displays a message if the user did not answer all questions or scored less than<br />

the chosen pass mark.<br />

If the user successfully answered the questions, he will be allowed to generate a<br />

certificate.The output of a successful visit is shown in Figure 32.3.<br />

Figure 32.3 The score.php script presents successful visitors with the<br />

option to generate a certificate in one of three ways.<br />

From here, the user has three options: He can have an RTF certificate or one of two<br />

PDF certificates. Next, we look at the script responsible for each.<br />

Generating an RTF Certificate<br />

There is nothing to stop you from generating an RTF document by writing ASCII text<br />

to a file or a string variable, but doing so would mean learning yet another set of syntax.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!