beginning_php_and_postgresql_e-commerce.pdf

(6684 KB) Pobierz
THE EXPERT’S VOICE ® IN OPEN SOURCE
Beginning
PHP and PostgreSQL
E-Commerce
From Novice to Professional
Learn how to use PHP, PostgreSQL, and sound
development practices to build high quality,
extensible e-commerce web sites in no time!
Cristian Darie, Emilian Balanescu,
and Mihai Bucica
1058193285.049.png 1058193285.060.png 1058193285.070.png 1058193285.081.png 1058193285.001.png 1058193285.010.png 1058193285.012.png 1058193285.013.png 1058193285.014.png 1058193285.015.png 1058193285.016.png 1058193285.017.png 1058193285.018.png 1058193285.019.png 1058193285.020.png 1058193285.021.png 1058193285.022.png 1058193285.023.png 1058193285.024.png 1058193285.025.png 1058193285.026.png 1058193285.027.png 1058193285.028.png 1058193285.029.png 1058193285.030.png 1058193285.031.png 1058193285.032.png 1058193285.033.png
 
1058193285.034.png
 
1058193285.035.png
 
1058193285.036.png
 
1058193285.037.png
 
1058193285.038.png 1058193285.039.png 1058193285.040.png 1058193285.041.png 1058193285.042.png 1058193285.043.png 1058193285.044.png 1058193285.045.png 1058193285.046.png 1058193285.047.png 1058193285.048.png
 
1058193285.050.png 1058193285.051.png 1058193285.052.png 1058193285.053.png 1058193285.054.png 1058193285.055.png 1058193285.056.png 1058193285.057.png 1058193285.058.png 1058193285.059.png 1058193285.061.png 1058193285.062.png 1058193285.063.png 1058193285.064.png 1058193285.065.png 1058193285.066.png 1058193285.067.png 1058193285.068.png 1058193285.069.png 1058193285.071.png 1058193285.072.png 1058193285.073.png 1058193285.074.png 1058193285.075.png 1058193285.076.png 1058193285.077.png 1058193285.078.png 1058193285.079.png 1058193285.080.png 1058193285.082.png 1058193285.083.png 1058193285.084.png 1058193285.085.png 1058193285.086.png 1058193285.087.png 1058193285.088.png 1058193285.089.png 1058193285.002.png
 
Beginning PHP and
PostgreSQL
E-Commerce
From Novice to Professional
Cristian Darie, Emilian Balanescu,
Mihai Bucica
1058193285.003.png 1058193285.004.png 1058193285.005.png 1058193285.006.png
Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional
Copyright © 2006 by Cristian Darie, Emilian Balanescu, Mihai Bucica
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-648-7
ISBN-10 (pbk): 1-59059-648-X
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Jason Gilmore
Technical Reviewer: Greg Sabino Mullane
Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick,
Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser,
Keir Thomas, Matt Wade
Project Manager: Kylie Johnston
Copy Edit Manager: Nicole Flores
Copy Editor: Julie McNamee
Assistant Production Director: Kari Brooks-Copony
Production Editor: Lori Bring
Compositor: Gina Rexrode
Proofreader: April Eddy
Indexer: John Collin
Artist: April Milne
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com , or
visit http://www.springeronline.com .
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley,
CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com , or visit http://www.apress.com .
The information in this book is distributed on an “as is” basis, without warranty. Although every pre
caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any lia-
bility to any person or entity with respect to any loss or damage caused or alleged to be caused directly or
indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the Source Code/
Download section.
1058193285.007.png
Contents at a Glance
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
■ ■ ■ Phase 1 of Development
PART 1
CHAPTER 1
Starting an E-Commerce Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
CHAPTER 2
Laying Out the Foundations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
CHAPTER 3
Creating the Product Catalog: Part I . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
CHAPTER 4
Creating the Product Catalog: Part II . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
CHAPTER 5
Searching the Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
CHAPTER 6
Receiving Payments Using PayPal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
CHAPTER 7
Catalog Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
■ ■ ■ Phase II of Development
PART 2
CHAPTER 8
The Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
CHAPTER 9
Dealing with Customer Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
CHAPTER 10
Product Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
■ ■ ■ Phase III of Development
PART 3
CHAPTER 11
Managing Customer Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
CHAPTER 12
Storing Customer Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
CHAPTER 13
Implementing the Order Pipeline: Part I . . . . . . . . . . . . . . . . . . . . . . . . 453
CHAPTER 14
Implementing the Order Pipeline: Part II . . . . . . . . . . . . . . . . . . . . . . . 477
CHAPTER 15
Credit Card Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
CHAPTER 16
Product Reviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
CHAPTER 17
Connecting to Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
APPENDIX A
Installing Apache, PHP, and PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . 571
APPENDIX B
Project Management Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 583
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
iii
 
1058193285.008.png 1058193285.009.png
Zgłoś jeśli naruszono regulamin