Introduction
“Content is king.” Clich, yes; but it has neverbeen more true. Once you've mastered HTML and learned a few neat tricks in
JavaScript and Dynamic HTML, you can probably design a pretty impressive-looking
Website. But your next task must be to fill that fancy page layout with some
real information. Any site that successfully attracts repeat visitors has
to have fresh and constantly updated content. In the world of traditional
site building, that means HTML files—and lots of 'em.The problem is that, more often than not, the people who provide the
content for a site are not the same people who handle its design. Frequently,
the content provider doesn't even know HTML. How, then,
is the content to get from the provider onto the Website? Not every company
can afford to staff a full-time Webmaster, and most Webmasters have better
things to do than copying Word files into HTML templates anyway.Maintenance of a content-driven site can be a real pain, too. Many sites
(perhaps yours?) feel locked into a dry, outdated design because rewriting
those hundreds of HTML files to reflect a new look would take forever. Server-side
includes (SSIs) can help alleviate the burden a little, but you still end
up with hundreds of files that need to be maintained should you wish to make
a fundamental change to your site.The solution to these headaches is database-driven site design. By achieving
complete separation between your site's design and the content you want to
present, you can work with each without disturbing the other. Instead of writing
an HTML file for every page of your site, you only need to write a page for
each kind of information you want to be able to present.
Instead of endlessly pasting new content into your tired page layouts, create
a simple content management system that allows the writers to post new content
themselves without a lick of HTML!In this book, I'll provide you with a hands-on look at what's involved
in building a database-driven Website. We'll use two tools for this, both
of which may be new to you: the PHP scripting language
and the MySQL relational database management system.
If your Web host provides PHP and MySQL support, you're in great shape. If
not, we'll be looking at the setup procedures under Linux, Windows, and Mac
OS X, so don't sweat it.
Who Should Read This Book
This book is aimed at intermediate or advanced Web designers looking
to make the leap into server-side programming. You'll be expected to be comfortable
with simple HTML, as I'll make use of it without much in the way of explanation.
No knowledge of JavaScript is assumed or required, but if you do know
JavaScript, you'll find it will make learning PHP a breeze.By the end of this book, you can expect to have a grasp of what's involved
in setting up and building a database-driven Website. If you follow the examples,
you'll also learn the basics of PHP (a
server-side scripting language that gives you easy access to a database, and
a lot more) and Structured Query Language (SQL —
the standard language for interacting with relational databases) as supported
by MySQL,
one of the most popular free database engines available today. Most importantly,
you'll come away with everything you need to get started on your very own
database-driven site in no time!