From the course: PHP: Exporting Data to Files

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Defining the page margins and the footer

Defining the page margins and the footer - PHP Tutorial

From the course: PHP: Exporting Data to Files

Start my 1-month free trial

Defining the page margins and the footer

This is cars_rich text.php, which you can find in the exercise files for this video. It's the same used cars example, from previous exercises. This time, it will generate a download file in rich text format, using PHPRtfLite. Although PHPRtfLite supports adding images to documents, I'm sticking with a text only example. Page layout in Rich Text Format, is cumbersome. You'll learn how to add images to text documents, later in this course. Make sure that you've copied the PHPRtfLite folder, to your testing site. You should also have a copy of PHPRtfLite.php. We need to include this file in our page, so after the opening PHP tag, require once. And it's src/PHPRftLite.php. PHPRtfLite has its own autoloader, so we need to register that. It's a static method, of the PHPRtfLite class. So PHPRtfLite, then the scope resolution operator, two colons and registerAutoloader. On line four, we're running the cars database query, using MySQL improve. Change MySQLli to PDO, if you are using SQLite, or…

Contents