Copyrighted Material
Total Page:16
File Type:pdf, Size:1020Kb
24_575872 bindex.qxd 5/27/05 6:28 PM Page 417 Index PHP, 53 • A • security, 41 abstract classes, 403–404 Security Sockets Layer (SSL), 41 abstraction, 387–388 application development accessing consistency in coding style, 376 methods, 395–396, 399–400 constants, 376 MySQL databases, 33–34 discussion lists, 378 MySQL from PHP scripts, 37 documentation, 378 properties, 395–396 PHP source code, 377 Account class (HTTP authentication application) planning, 19–22, 375 code, 66–68 readability of code, 376 comparePassword method, 69–70 resource planning, 21–22 constructor, 68–69 reusable code, 377 properties, 66 schedule, 21 selectAccount method, 69 separating page layout from function, 377 Account class (user login application) testing code incrementally, 376 comparePassword method, 112 application scripts constructor, 111 accessing MySQL, 37 Admin-OO.php createNewAccount method, 112–114 , 303–307 Admin.php getMessage method, 112 , 269–274 Auth-OO.php selectAccount method, 111 , 73–76 Catalog-oo.php accounts (MySQL) , 155–157 CompanyHome-OO.php creating, 35–36 , 294–300 CompanyHome.php modifying, 35 , 253–262 passwords, 35–36 error handling, 32–33 Login-OO.php permissions, 35 , 119–125, 293 login.php root, 35 , 92–100, 246–249 Orders-oo.php activating MySQL, 12–13 , 224–230 addCart method, 220 outside sources, 25–30 postMessage-OO.php AddField method, 327 , 361–363 postMessage.php addItem method, 214 , 339–342 postReply-OO.php addslashes function, 39COPYRIGHTED MATERIAL, 364–368 postReply.php Admin-OO.php script, 303–307 , 342–345 ProcessOrder.php Admin.php script, 269–274 , 200–207 ShopCatalog.php AllowOverride Authconfig directive, 50 , 193–194, 196–197 ShoppingCart.php AllowOverride None directive, 50 , 197–200 Apache Web server system calls, 31–32 viewForums-OO.php configuration file, 49 , 359–360 viewForums.php encryption, 41 , 337–338 viewThread-OO.php .htaccess file, 50–51 , 361 viewThread.php HTTP authentication, 49–52 , 338–339 viewTopic-OO.php password file, 51 , 360 viewTopic.php, 338 24_575872 bindex.qxd 5/27/05 6:28 PM Page 418 418 PHP & MySQL Everyday Apps For Dummies applications Brown, David William (An Introduction to Object- content management system (CMS), 235–236 Oriented Analysis: Objects and UML in Plain HTTP authentication application, 52 English, 2nd Edition), 275 mailing list application, 414 built-in functions object-oriented code, 15–16 addslashes, 39 online catalog application, 131–132 MySQL extension, 12–13, 407–409 procedural code, 15–16 MySQL Improved extension, 12–13, 407–409 shopping cart application, 159–161 strip_tags, 110, 222, 292, 359 user login application, 77–78 trim, 110, 222, 292, 359 Web forum, 309 Arachnoid Web site, 17 Arachnophilia programming editor, 17 • C • attributes (objects), 386–387 cart application authentication. See HTTP authentication Add Items to Shopping Cart button, 167 authentication application Cancel Order button, 169 Account object, 60, 66–70 Catalog class, 208–210 Auth-OO.php script, 73–76 confirmation of order Web page, 170 Database object, 60, 62–66 Continue Shopping button, 168–169 features, 52 cookies, 161 functionality, 54 credit card handling, 160 object-oriented code, 60–73 customer feedback, 161 PasswordPrompter object, 60–62 customer login, 159–160, 231 procedural code, 56–60 database, 162–166 user database, 54–56 Database class, 216 WebPage object, 60, 71–73 databases, 161 welcome page, 59–60 Edit Shipping Information button, 169 AuthName section (.htaccess file), 50 Email class, 223 Auth-OO.php script, 73–76 fields_cart.inc file, 175–177 author control (Web forum), 336 fields_cart-oo.inc file, 179–182 author’s Web site, 414–415 fields_products_page.inc file, 171–172 AuthType section (.htaccess file), 50 fields_ship_info.inc file, 182–184 fields_ship_info-oo.inc file, 184–185 fields_summary.inc file, 188–190 • B • fields_summary-oo.inc file, 190 backups for MySQL databases, 40–41 functionality, 161 backward compatibility, 10 inventory, 231 Barebones Web site, 17–18 Item class, 210–212 BaseInfo class Order class, 216–221 code, 278–279 order tracking, 231 constructor, 279 Orders-oo.php script, 223–230 description, 276 PayPal, 160 getConnection method, 279 ProcessOrder.php script, 200–207 getId method, 279 product information Web page, 166–167 getName method, 279 purchasing methods, 160 properties, 278 session variables, 161 BBCode, 372 shipping fees, 160 BBEdit programming editor, 17 shipping form Web page, 168–169 body control (Web forum), 336 ShopCatalog.php script, 193–197 bonus chapter (CD-ROM), 414 shopping cart Web page, 168 24_575872 bindex.qxd 5/27/05 6:28 PM Page 419 Index 419 ShoppingCart class, 212–215 system requirements, 411 ShoppingCart.php script, 197–200 technical support, 415 shopping_product_page.inc file, 171–175 troubleshooting, 414–415 single_form.inc file, 182, 185–187 Chambers, Mark L. (iMacs For Dummies, 4th Edition), storing contents, 161 411–412 Submit Order button, 168–169 checkAddress method, 110 summary of order Web page, 169–170 checkEmail method, 110 summary_form.inc file, 188 checkForBlanks method (WebForm class) summary_page.inc file, 190–192 content management system, 292 table_page.inc file, 175, 177–179 shopping cart application, 222 table_page-oo.inc file, 179 user login application, 108 Update Cart button, 168 Web forum application, 358 View Shopping Cart button, 167 checkName method, 110 WebForm class, 221–222 checkPhone method, 110 WebPage class, 222 checkState method, 110 catalog application checkZip method, 110 Catalog class, 150–155, 157–158 child classes, 388–389 Catalog-oo.php script, 155–157 class files, 13 database, 132–135 class statement functionality, 131–132 accessing methods/properties, 395–396 functions_main.inc file, 148–149 class code, 392 index Web page, 136–140, 145 constructor, 396–397 object-oriented code, 149–155 format, 391 procedural code, 145–149 methods, 394–395 products Web page, 137, 140–145 naming classes, 392 Catalog class (catalog application) properties, 392–394 adding functionality, 157–158 classes code, 150–153 abstract classes, 403–404 constructor, 153–154 Account class (HTTP authentication application), displayAllofType method, 155 66–70 displayCategories method, 154 Account class (user login application), 111–114 getAllofType method, 154 BaseInfo class, 276, 278–279 getCategoryAndTypes method, 154 Catalog class (catalog application), 150–155 properties, 150 Catalog class (shopping cart application), 208–210 selectCatalog method, 154 child classes, 388–389 Catalog class (shopping cart application) ContentDownload class, 276, 289–291 constructor, 208 ContentItem class, 276, 283–289 getConnection method, 208 ContentType class, 276, 282–283 getName method, 208–210 Database class (content management system), getPrice method, 208–210 276, 292 useDatabase method, 208 Database class (HTTP authentication application), Catalog-oo.php script, 155–157 62–66 CD-ROM Database class (shopping cart application), 216 bonus chapter, 414 Database class (user login application), 110–111 helpful Web site links, 413–414 Database class (Web forum application), 357–358 installing, 412 defined, 386 license agreement, 412 Department class, 275–276, 279–281 ReadMe file, 411 Email class (shopping cart application), 223 source code files, 412–413 Email class (user login application), 117–119 24_575872 bindex.qxd 5/27/05 6:28 PM Page 420 420 PHP & MySQL Everyday Apps For Dummies classes (continued) home Web page, 243–244 Exception class, 400–401 intranet, 236 inheritance, 398–399 keyword search, 307 instantiation, 390 login Web page, 243–244 Item class, 210–212 Login-OO.php script, 293 master class, 388 login.php script, 246–249 methods, 387, 394–395, 399–400 paging navigation, 307 naming, 392 permissions, 236 Order class, 216–221 uploading files, 236 parent class, 388 WebForm class, 276, 292 PasswordPrompter class, 61–62 code. See also PHP source code Post class, 355–357 Account class (HTTP authentication application), properties, 400 66–68 Session class, 114–117 BaseInfo class, 278–279 ShoppingCart class, 212–215 Catalog class (catalog application), 150–153 subclasses, 388–389 consistency, 376 TableAccessor class, 349–353 constants, 376 Thread class, 353–354 ContentDownload class, 289–291 WebForm class (content management system), ContentItem class, 284–288 276, 292 ContentType class, 282–283 WebForm class (shopping cart application), 221–222 conventions, 1–2 WebForm class (user login application), 102–110 Database class (HTTP authentication application), WebForm class (Web forum application), 358–359 62–64 WebPage class (HTTP authentication application), Database class (user login application), 110 71–73 Department class, 280–281 WebPage class (shopping cart application), 222 Email class, 117–118 CMS (content management system) Item class, 210–211 Admin-OO.php script, 303–307 object-oriented code, 15–16 Admin.php script, 269–274 Order class, 216–219 BaseInfo class, 276, 278–279 PasswordPrompter class, 61 CompanyHome-OO.php script, 294–300 Post class, 355–356 CompanyHome.php script, 253–262 procedural code, 15–16 company.inc file, 262–265 readability, 376 company-OO.inc file, 301–303 reusable code, 377 content detail Web page, 243, 245–246 separating page layout from function, 377 content list Web page, 243, 245 Session class, 114–115 content types, 235–236 ShoppingCart class, 212–214 ContentDownload class, 276, 289–291 TableAccessor class, 349–351 content_form.inc file, 266–268, 294, 303 testing code incrementally, 376 ContentItem class, 276, 283–289 Thread class, 353–354 ContentType class, 276, 282–283 WebForm