Sams Teach Yourself PHP, MySQL and Apache All in One

Other Format
from $0.00

Author: Julie C. Meloni

ISBN-10: 0672328739

ISBN-13: 9780672328732

Category: Applications & Languages - Databases

Search in google:

A new edition of this title is available, ISBN-10: 067232976X ISBN-13: 9780672329760You own your own business. You have also created a website for your business that details the products or services that you offer, but it doesn't allow potential customers to purchase anything online. Don't risk losing business-learn to create a dynamic online environment using only three programs. PHP, MySQL and Apache are three popular open-source tools that can work together to help you create a dynamic website, such as an online shopping experience. Sams Teach Yourself PHP, MySQL and Apache All in One is a complete reference manual for all three development tools. You will learn how to install, configure and set up the PHP scripting language, use the MySQL database system, and work with the Apache Web server. Then you'll take it a step further and discover how they work together to create a dynamic website. Use the book and the included CD to create a simple website, as well as a mailing list, online address book, shopping cart and storefront. Updated to reflect the most recent developments in PHP and MySQL, including the final stable release of MySQL 5.0, you will open your website to limitless possibilities with Sams Teach Yourself PHP, MySQL and Apache All in One.

IntroductionWho Should Read This Book?How This Book Is OrganizedConventions Used in This BookPart I: Laying the GroundworkChapter 1: Installation QuickStart GuideLinux/UNIX Installation Installing MySQLInstalling ApacheInstalling PHPWindows Installation Installing MySQLInstalling ApacheInstalling PHPMac OS X Installation Installing MySQLInstalling PHPTroubleshooting Chapter 2: Installing and Configuring MySQLCurrent and Future Versions of MySQL How to Get MySQL Installing MySQL on Linux/UNIX Installing MySQL on Mac OS X Installing MySQL on Windows Troubleshooting Your Installation Basic Security Guidelines Starting MySQLSecuring Your MySQL ConnectionIntroducing the MySQL Privilege System The Two-Step Authentication ProcessWorking with User Privileges Adding UsersRemoving PrivilegesChapter 3: Installing and Configuring ApacheCurrent and Future Versions of Apache Choosing the Appropriate Installation Method Building from SourceInstalling a BinaryInstalling Apache on Linux/UNIX Downloading the Apache Source CodeUncompressing the Source CodePreparing to Build ApacheBuilding and Installing ApacheInstalling Apache on Mac OS X Installing Apache on Windows Apache Configuration File Structure DirectivesContainersConditional EvaluationThe ServerRoot DirectivePer-Directory Configuration FilesApache Log Files The access_log FileThe error_log FileAdditional FilesApache-Related Commands Apache Server BinaryApache Control ScriptStarting Apache for the First Time Check Your Configuration FileStarting ApacheTroubleshooting Already an Existing Web ServerNo Permission to Bind to PortAccess DeniedWrong Group SettingsChapter 4: Installing and Configuring PHPCurrent and Future Versions of PHP Building PHP on Linux/UNIX with Apache Additional Linux/UNIX Configuration OptionsIntegrating PHP with Apache on Linux/UNIXInstalling PHP on Mac OS X Installing PHP on Windows Integrating PHP with Apache on Windowsphp.ini Basics Testing Your Installation Getting Installation Help The Basics of PHP Scripts Beginning and Ending a Block of PHP StatementsThe echo Statement and print() FunctionCombining HTML and PHPAdding Comments to PHP CodePart II: PHP Language StructureChapter 5: The Building Blocks of PHPVariables Globals and SuperglobalsData Types Changing Type with settype()Changing Type by CastingWhy Test Type?Operators and Expressions The Assignment OperatorArithmetic OperatorsThe Concatenation OperatorCombined Assignment OperatorsAutomatically Incrementing and Decrementing an Integer VariableComparison OperatorsCreating Complex Test Expressions with the Logical OperatorsOperator PrecedenceConstants Predefined ConstantsChapter 6: Flow Control Functions in PHPSwitching Flow The if StatementUsing the else Clause with the if StatementUsing the elseif Clause with the if StatementThe switch StatementUsing the ? OperatorLoops The while StatementThe do...while StatementThe for StatementBreaking Out of Loops with the break StatementSkipping an Iteration with the continue StatementNesting LoopsCode Blocks and Browser Output Chapter 7: Working with FunctionsWhat Is a Function? Calling Functions Defining a Function Returning Values from User-Defined Functions Variable Scope Accessing Variables with the global StatementSaving State Between Function Calls with the static Statement More About Arguments Setting Default Values for ArgumentsPassing Variable References to FunctionsTesting for the Existence of a Function Chapter 8: Working with ArraysWhat Are Arrays? Creating Arrays Creating Associative ArraysCreating Multidimensional ArraysSome Array-Related Functions Chapter 9: Working with ObjectsCreating an Object Properties of ObjectsObject MethodsConstructorsObject Inheritance Part III: Getting Involved with the CodeChapter 10: Working with Strings, Dates, and TimeFormatting Strings with PHP Working with printf()Specifying a Field WidthArgument SwappingStoring a Formatted StringInvestigating Strings in PHP A Note About Indexing StringsFinding the Length of a String with strlen()Finding a Substring Within a String with strstr()Finding the Position of a Substring with strpos()Extracting Part of a String with substr()Tokenizing a String with strtok()Manipulating Strings with PHP Cleaning Up a String with trim(), ltrim(), and strip_tags()Replacing a Portion of a String Using substr_replace()Replacing Substrings Using str_replaceConverting CaseWrapping Text with wordwrap() and nl2br()Breaking Strings into Arrays with explode()Using Date and Time Functions in PHP Getting the Date with time()Converting a Time Stamp with getdate()Converting a Time Stamp with date()Creating Time Stamps with mktime()Testing a Date with checkdate()Other String, Date, and Time Functions Chapter 11: Working with FormsCreating a Simple Input Form Accessing Form Input with User-Defined Arrays Combining HTML and PHP Code on a Single Page Using Hidden Fields to Save State Redirecting the User Sending Mail on Form Submission System Configuration for the mail() FunctionCreating the FormCreating the Script to Send the MailFormatting Your Mail with HTMLWorking with File Uploads Creating the File Upload FormCreating the File Upload ScriptChapter 12: Working with Cookies and User SessionsIntroducing Cookies The Anatomy of a CookieSetting a Cookie with PHP Deleting a CookieSession Function Overview Starting a Session Working with Session Variables Passing Session IDs in the Query String Destroying Sessions and Unsetting Variables Using Sessions in an Environment with Registered Users Working with Registered UsersWorking with User PreferencesChapter 13: Working with Files and DirectoriesIncluding Files with include() Returning a Value from an Included DocumentUsing include() Within Control StructuresUsing include_once()The include_path DirectiveValidating Files Checking for Existence with file_exists()A File or a Directory?Checking the Status of a FileDetermining File Size with filesize()Getting Date Information About a FileCreating a Function That Performs Multiple File TestsCreating and Deleting Files Opening a File for Writing, Reading, or Appending Reading from Files Reading Lines from a File with fgets() and feof()Reading Arbitrary Amounts of Data from a File with fread()Reading Characters from a File with fgetc()Writing or Appending to a File Writing to a File with fwrite() or fputs()Locking Files with flock()Working with Directories Creating Directories with mkdir()Removing a Directory with rmdir()Opening a Directory for Reading with opendir()Reading the Contents of a Directory with readdir()Opening Pipes to and from Processes Using popen() Running Commands with exec() Running Commands with system() or passthru() Chapter 14: Working with ImagesUnderstanding the Image-Creation Process A Word About ColorNecessary Modifications to PHP Obtaining Additional LibrariesDrawing a New Image Drawing Shapes and LinesUsing a Color FillGetting Fancy with Pie Charts Modifying Existing Images Image Creation from User Input Part IV: PHP and MySQL IntegrationChapter 15: Understanding the Database Design ProcessThe Importance of Good Database Design Types of Table Relationships One-to-One RelationshipsOne-to-Many RelationshipsMany-to-Many RelationshipsUnderstanding Normalization Problems with the Flat TableFirst Normal FormSecond Normal FormThird Normal FormFollowing the Design Process Chapter 16: Learning Basic SQL CommandsLearning the MySQL Data Types Numeric Data TypesDate and Time TypesString TypesLearning the Table Creation Syntax Using the INSERT Command A Closer Look at INSERTUsing the SELECT Command Ordering SELECT ResultsLimiting Your ResultsUsing WHERE in Your Queries Using Operators in WHERE ClausesString Comparison Using LIKESelecting from Multiple Tables Using JOINUsing SubqueriesUsing the UPDATE Command to Modify Records Conditional UPDATEsUsing Existing Column Values with UPDATEUsing the REPLACE Command Using the DELETE Command Conditional DELETEFrequently Used String Functions in MySQL Length and Concatenation FunctionsTrimming and Padding FunctionsLocation and Position FunctionsSubstring FunctionsString Modification FunctionsUsing Date and Time Functions in MySQL Working with DaysWorking with Months and YearsWorking with WeeksWorking with Hours, Minutes, and SecondsFormatting Dates and Times with MySQLPerforming Date Arithmetic with MySQLSpecial Functions and Conversion FeaturesChapter 17: Using Transactions and Stored Procedures in MySQLWhat Are Transactions? Basic Syntax Used in TransactionsWorking Example Using TransactionsWhat Are Stored Procedures? Basic Syntax of Stored ProceduresChapter 18: Interacting with MySQL Using PHPMySQL Versus MySQLi Functions Connecting to MySQL with PHP Making a ConnectionExecuting QueriesRetrieving Error MessagesWorking with MySQL Data Inserting Data with PHPRetrieving Data with PHPAdditional MySQL Functions in PHPPart V: Basic ProjectsChapter 19: Managing a Simple Mailing ListDeveloping the Subscription Mechanism Creating the subscribers TableCreating the Subscription FormDeveloping the Mailing Mechanism Chapter 20: Creating an Online Address BookPlanning and Creating the Database Tables Creating a Menu Creating the Record Addition Mechanism Viewing Records Creating the Record Deletion Mechanism Adding Subentries to a Record Chapter 21: Creating a Simple Discussion ForumDesigning the Database Tables Creating the Input Forms and Scripts Displaying the Topic List Displaying the Posts in a Topic Adding Posts to a Topic Chapter 22: Creating an Online StorefrontPlanning and Creating the Database Tables Inserting Records into the store_categories TableInserting Records into the store_items TableInserting Records into the store_item_size TableInserting Records into the store_item_color TableDisplaying Categories of Items Displaying Items Chapter 23: Creating a Shopping Cart MechanismPlanning and Creating the Database Tables Integrating the Cart with Your Storefront Adding Items to Your CartViewing the CartRemoving Items from Your CartPayment Methods and the Checkout Sequence Creating the Checkout FormPerforming the Checkout ActionsChapter 24: Creating a Simple CalendarBuilding a Simple Display Calendar Checking User InputBuilding the HTML FormCreating the Calendar TableAdding Events to the CalendarCreating a Calendar Library Chapter 25: Restricting Access to Your ApplicationsAuthentication Overview Client AuthenticationApache Authentication Module Functionality File-Based AuthenticationDatabase File-Based Access ControlUsing Apache for Access Control Implementing Access RulesEvaluating Access RulesCombining Apache Access Methods Limiting Access Based on HTTP Methods Restricting Access Based on Cookie Values Creating the Authorized Users TableCreating the Login Form and ScriptTesting for the auth CookieChapter 26: Logging and Monitoring Web Server ActivityStandard Apache Access Logging Deciding What to LogLogging Accesses to FilesLogging Accesses to a ProgramStandard Apache Error Logging Logging Errors to a FileLogging Errors to a ProgramThe syslog Daemon ArgumentThe LogLevel DirectiveManaging Apache Logs Resolving HostnamesLog RotationMerging and Splitting LogsLog AnalysisMonitoring Error LogsLogging Custom Information to a Database Creating the Database TableCreating the PHP Code SnippetCreating Sample ReportsChapter 27: Application LocalizationAbout Internationalization and Localization About Character Sets Environment Modifications Configuration Changes to ApacheConfiguration Changes to PHPConfiguration Changes to MySQLCreating a Localized Page Structure Chapter 28: Working withWhat IsBasicAccessingAccessingPart VI: Administration and Fine-tuningChapter 29: Apache Performance Tuning and Virtual HostingScalability Issues Operating System LimitsPerformance-Related Apache SettingsLoad Testing with ApacheBench Proactive Performance Tuning Mapping Files to MemoryDistributing the LoadCachingReduce Transmitted DataNetwork SettingsPreventing Abuse RobotsImplementing Virtual Hosting IP-Based Virtual HostingName-Based Virtual HostsMass Virtual HostingChapter 30: Setting Up a Secure Web ServerThe Need for Security The SSL Protocol Addressing the Need for ConfidentialityAddressing the Need for IntegrityAddressing the Need for AuthenticationObtaining and Installing SSL Tools OpenSSLThe mod_ssl Apache ModuleManaging Certificates Creating a Key PairCreating a Certificate Signing RequestCreating a Self-Signed CertificateSSL Configuration Starting the ServerChapter 31: Optimizing and Tuning MySQLBuilding an Optimized Platform Using the benchmark() FunctionMySQL Startup Options Key Startup ParametersOptimizing Your Table Structure Optimizing Your Queries Using the FLUSH Command Using the SHOW Command Retrieving Information About Databases and TablesRetrieving Table Structure InformationRetrieving System StatusChapter 32: Software UpgradesStaying in the Loop When to UpgradeUpgrading MySQL Upgrading Apache Modifying Apache Without UpgradingUpgrading PHP Using PECL and PEAR to Extend PHPIndex