Skip to Content
PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
book

PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide

by Larry Ullman
May 2003
Intermediate to advanced
592 pages
14h 28m
English
Peachpit Press
Content preview from PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide

Security

Database security with respect to PHP comes down to two broad issues:

  1. Protecting the database access information

  2. Being cautious when inserting data in the database

You can accomplish the first objective by securing the MySQL connection script outside of the Web directory so it is never viewable through a Web browser. I discussed this idea earlier in the chapter and will discuss it more in Chapter 8.

For the second objective, there are numerous options. First, as I’ve been doing in this chapter, is to use the $_POST array (or $HTTP_GET_VARS, $HTTP_POST_VARS, or $_GET) instead of global variables. Second is to use regular expressions to make sure that submitted data matches what you would expect it to be. Regular expressions will also ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition

PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition

Larry Ullman

Publisher Resources

ISBN: 0321186486Purchase book