Specifications
TABLE 30.1 Continued
Name Type Description
pdflib.php Application Script to generate PDF
certificate using PDFlib
signature.tif image Bitmap image of signature
to be included on the
PDFlib certificate
PHPCertification.rtf RTF RTF certificate template
PHPCertification.pdf PDF PDF certificate template
Let’s go ahead and look at the application.
Asking the Questions
The file index.html is straightforward. It needs to contain an HTML form asking the user for
his name, and the answer to a number of questions. In a real assessment application, we would
most likely retrieve these questions from a database. Here we are focusing on producing the
certificate, so we will just hard-code some questions into the HTML.
The name field is a text input. Each question has three radio buttons to allow the user to indi-
cate his preferred answer. The form has an image button as a submit button.
The code for this page is shown in Listing 30.1.
LISTING 30.1 index.html—HTML Page Containing Quiz Questions
<html>
<body>
<h1><p align = center>
<img src = “rosette.gif” alt = “”>
Certification
<img src = “rosette.gif” alt = “”></h1>
<p>You too can earn your highly respected PHP certification
from the world famous Fictional Institute of PHP Certification.
<p>Simply answer the questions below:
<form action = score.php method = post>
<p>Your Name <input type = text name = name>
<p>What does the PHP statement echo do?
<ol>
Generating Personalized Documents in Portable Document Format (PDF)
C
HAPTER 30
30
GENERATING
PERSONALIZED
DOCUMENTS IN
PDF
753
36 7842 CH30 3/6/01 3:40 PM Page 753