... E-commerce and Security
12 Running an E-commerce Site 261
13 E-commerce Security Issues 273
14 Implementing Authentication with PHP and
MySQL 293
15 Implementing Secure Transactions with PHP and
MySQL ... Using MySQL
7 Designing Your Web Database 169
8 Creating Your Web Database 181
9 Working with Your MySQL Database 203
10 Accessing Your MySQL Database from the Web...
... xxxiv
Introduction
WELCOME TO PHP AND
MYSQL W
EB DEVELOPMENT
.Within its pages, you will find
distilled knowledge from our experiences using PHP and MySQL, two of the hottest
Web development tools around.
In ... author
of numerous articles about Linux, Apache, PHP, and MySQL. He has worked for compa-
nies such as GE and Procter & Gamble with mainly Unix-based comput...
... discuss aspects of electronic commerce and security as they relate to
building a real-world Web site, and show you how to implement these aspects in PHP
and MySQL.
In the final section of this book, ... for the Web. Within an
HTML page, you can embed PHP code that will be executed each time the page is vis-
ited.Your PHP code is interpreted at the Web server and generates...
... is between 0 and 100.
We would need to test the conditions $a >= 0 and $a <= 100, using the AND opera-
tor, as follows
$a >= 0 && $a <=100
PHP supports logical AND, OR, XOR ... versa
&& AND $a && $b Returns true if both $a and $b are true; oth-
erwise
false
|| OR $a || $b Returns true if either $a or $b or both are
true; otherwise false
and...
... feedback and sends the mail to the appro-
priate person. If, for example, the customer feedback reads “I still haven’t received deliv-
ery of my last order,” the string “delivery” will be detected and ... work in PHP 4—in earlier versions you can test for false by
testing the return value to see if it is a string (that is, false).
Replacing Substrings: str_replace(), substr_replace()
Fi...
... way.The function phpinfo() is often
useful in testing because it displays the installed version of PHP, information about PHP,
the Web server set-up, and the values of various PHP and server variables.This ... of PHP.
Using Functions in PHP
Functions exist in most programming languages.They are used to separate code that per-
forms a single, well-defined task.This makes the cod...
... cannot
have the same name as any built-in function or an existing user-defined function. Note
that although every PHP script knows about all the built-in functions, user-defined
functions only exist ... elsewhere in a PHP script
including function calls, declarations of new variables or functions, require() or
include() statements, and plain HTML. If we want to exit PHP within a funct...
... database and
table names can be—more on this later.
How to Log in to MySQL
To do this, go to a command line interface on your machine and type the following:
mysql -h hostname -u username -p
Your ... command prompt might look different depending on the operating system and
shell you are using.
The mysql command invokes the MySQL monitor.This is a command line client
that connect...