Alan Forbes - The Joy of PHP 1

Similar documents
Table of Contents. Introduction. What is PHP? Introducing PHP Example A little history Installing and Configuring PHP

Mobile Site Development

Web development using PHP & MySQL with HTML5, CSS, JavaScript

Static Webpage Development

PHP & MySQL In Easy Steps Ebooks Free

All India Council For Research & Training

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 (

An Introduction to JavaScript & Bootstrap Basic concept used in responsive website development Form Validation Creating templates

PHP6 AND MYSQL BIBLE BY STEVE SUEHRING, TIM CONVERSE, JOYCE PARK

Ampliación de Bases de Datos

A Web-Based Introduction

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

PHP 1. Introduction Temasek Polytechnic

PHP & My SQL Duration-4-6 Months

Get in Touch Module 1 - Core PHP XHTML

Ministry of Higher Education and Scientific Research

Alpha College of Engineering and Technology. Question Bank

Setting Up a Development Server What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows Testing the InstallationAlternative WAMPs Installing a

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Web Site Development with HTML/JavaScrip

PHP WITH ANGULAR CURRICULUM. What you will Be Able to Achieve During This Course

CORE PHP CURRICULUM. Introductory Session Web Architecture Overview of PHP Platform Origins of PHP in the open source community

How to Create a NetBeans PHP Project

CS Final Exam Review Suggestions - Spring 2018

CERTIFICATE IN WEB PROGRAMMING

Programming the World Wide Web by Robert W. Sebesta

Web Development & SEO (Summer Training Program) 4 Weeks/30 Days

Introduction to AngularJS

Web Development. With PHP. Web Development With PHP

E-Business Systems 1 INTE2047 Lab Exercises. Lab 5 Valid HTML, Home Page & Editor Tables

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Princess Nourah bint Abdulrahman University. Computer Sciences Department

What is PHP? [1] Figure 1 [1]

Programming: Computer Programming For Beginners: Learn The Basics Of Java, SQL & C Edition (Coding, C Programming, Java Programming, SQL

Web Portfolio Design and Applications

Professional Course in Web Designing & Development 5-6 Months

CONTENTS IN DETAIL INTRODUCTION 1 THE FAQS OF LIFE THE SCRIPTS EVERY PHP PROGRAMMER WANTS (OR NEEDS) TO KNOW 1 2 CONFIGURING PHP 19

Software. Full Stack Web Development Intensive, Fall Lecture Topics. Class Sessions. Grading

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

MySQL and PHP - Developing Dynamic Web Applications

JSN PowerAdmin Configuration Manual Introduction

WEBD 236 Lab 5. Problem

XML. Jonathan Geisler. April 18, 2008

National College of Ireland BSc in Computing 2017/2018. Deividas Sevcenko X Multi-calendar.

Introduction to Web Development

Agenda. 1. Brief History of PHP. 2. Getting started. 3. Examples

('cre Learning that works for Utah STRANDS AND STANDARDS WEB DEVELOPMENT 1

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

ABOUT WEB TECHNOLOGY COURSE SCOPE:

Creating HTML files using Notepad

Full file at New Perspectives on HTML and CSS 6 th Edition Instructor s Manual 1 of 13. HTML and CSS

COMS 359: Interactive Media

contents Take Action! writing a plan page 21 making money page 66 usability testing page 129 improving site speed page 218 increasing traffic page 266

DevShala Technologies A-51, Sector 64 Noida, Uttar Pradesh PIN Contact us

Web Design & Dev. Combo. By Alabian Solutions Ltd , 2016

Core PHP. PHP output mechanism. Introducing. Language basics. Installing & Configuring PHP. Introducing of PHP keywords. Operators & expressions

ICT PHP Coding Standards

Introduction to PHP. Handling Html Form With Php. Decisions and loop. Function. String. Array

PHP Online Training. PHP Online TrainingCourse Duration - 45 Days. Call us: HTML

PHP and MySgi. John Wiley & Sons, Inc. 24-HOUR TRAINER. Andrea Tarr WILEY

Fundamentals of Web Development. Web Development. Fundamentals of. Global edition. Global edition. Randy Connolly Ricardo Hoar

Introduction to Web Concepts & Technologies

Pixelsilk Training Manual 8/25/2011. Pixelsilk Training. Copyright Pixelsilk

Web Programming HTML CSS JavaScript Step by step Exercises Hans-Petter Halvorsen

Web Development IB PRECISION EXAMS

Mastering phpmyadmiri 3.4 for

Sections and Articles

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310

PHP CURRICULUM 6 WEEKS

Helpline No WhatsApp No.:

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP?

Converting a HTML website to Wordpress

CompuScholar, Inc. Alignment to Utah's Web Development I Standards

PHP + ANGULAR4 CURRICULUM 6 WEEKS

School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University

SAS Simulation Studio 14.1: User s Guide. Introduction to SAS Simulation Studio

Vebra Search Integration Guide

Manual Sublime Text 2 License Key Windows

Web Database Applications With PHP & MySQL By David Lane, Hugh E. Williams

Exam : 9A Title : Adobe GoLive CS2 ACE Exam. Version : DEMO

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Section 1. How to use Brackets to develop JavaScript applications

INSTITUTE OF TECHNOLOGY AND ADVANCED LEARNING SCHOOL OF APPLIED TECHNOLOGY COURSE OUTLINE ACADEMIC YEAR 2012/2013

Chapter 1 Introduction to HTML, XHTML, and CSS

Databases on the web

Tutorial Point On Html5 Pdf

Understanding Page Template Components. Brandon Scheirman Instructional Designer, OmniUpdate

Introduction to Dreamweaver CS4:

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

Tutorial Point Servlets Pdf

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević

Tutorial Html Code Pdf Ebooks For Beginners With Examples

COMP519 Practical 5 JavaScript (1)

Full version is >>> HERE <<<

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Practical C Programming (Nutshell Handbooks) Ebooks Free

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Chapter 10: Understanding the Standards

Web Development. with Bootstrap, PHP & WordPress

Transcription:

Alan Forbes - The Joy of PHP 1

The Joy of Programming PHP Copyright 2013 by Alan Forbes. All rights reserved, including the right to reproduce this book, or portions thereof, in any form. The scanning, hosting, downloading, or otherwise sharing this book over the Internet without the permission of the author is illegal and punishable by law and not very nice. Please encourage me to write another book by buying your own copy. This ebook is for your personal use only. This ebook may not be re-sold or given away to other people. If you would like to share this book with another person, please purchase an additional copy for each person you share it with. If you are reading this book and did not purchase it, or it was not purchased for your exclusive use only, then you should purchase your own copy. Thank you for respecting the hard work of the author who put hundreds of hours of effort into making it all look easy. Alan Forbes - The Joy of PHP 3

Table of Contents Introduction...10 Introduction...10 Praise for The Joy of PHP...12 Foreword...13 Sponsors...14 CWS Technology...14 Site5...14 Matraex...14 mindworks GmbH...15 Other Kickstarter Backers of Note...15 What is PHP?...16 Introducing PHP...17 Example...18 A little history...19 Installing and Configuring PHP...21 Introduction...21 Windows Users...21 Using WampServer...22 Mac Users...23 How Do I Know it is Working?...23 Oracle VM Virtual Box...25 Installing for a Web Site...25 Exercise...26 Introduction to HTML...27 Introduction...27 Basic HTML...27 Basic Elements of HTML...28 Tags...28 Nested Tags...29 Required tags...29 Alan Forbes - The Joy of PHP 4

DocType...29 Head...30 Optional Tags...30 Meta Tags...30 Useful Tags...30 Headers...30 DIV...31 Images/Picture...31 Links...31 Lists...32 Exercise...32 HTML Tables...32 Table Example...33 HTML Table Headers...33 HTML Forms...34 The Input tag...35 HTML Form Actions & Methods...36 Basic PHP Syntax...38 Introduction - Basic PHP Syntax...38 Your first PHP-enabled page Hello World!...38 Some Fun Right Away...40 A Countdown Counter...40 Exercise...42 Editors and Staying Organized...43 Editors...43 Microsoft Expression Web...43 phpstorm...44 EditRocket...45 Free Editors...45 Includes...45 Basic example...46 HTML example...46 Code example...47 Alan Forbes - The Joy of PHP 5

Best Practices...47 Variables, Numbers, Dates, and Strings...48 Variables...48 Variable Naming Conventions and Best Practices...49 Numbers...50 Basic Arithmetic...50 Common Arithmetic Shortcuts...51 Useful Numeric Functions...51 Strings...51 Useful String Functions...52 Sources of Documentation...52 Exercise...52 How to Interpret PHP.NET documentation...52 Return Value...54 Function Name...54 Parameters...54 Dates...55 Example: Calculating Age in Years...57 Variable Scope...58 Control Structures...59 Introduction...59 if...59 if... else...60 Exercise: Open Hours...60 PHP Switch...61 PHP Looping...61 PHP while...61 PHP for...62 How to use a database, such as mysql...64 Introduction...64 What are Databases?...64 Getting Started with phpmyadmin...66 What is phpmyadmin?...67 Alan Forbes - The Joy of PHP 6

Using phpmyadmin to create a database...67 Introduction to SQL...68 Using phpmyadmin to create a Table in a database...68 Defining our first table...70 What defines an automobile?...70 Datatypes...71 Numbers...71 Characters...71 Dates...71 Exercise: Create a Table...74 Working with SQL Statements...75 INSERT Statements...75 SELECT Statements...76 WHERE Statements...78 Comparison Operators...80 ORDER BY...80 UPDATE Statements...81 DELETE Statements...81 Using mysql and PHP Together...83 Introduction...83 Code!...83 Code Listing: createdb.php...84 Code Explained: createdb.php...87 Hey, where's the HTML?...90 Creating forms to Display, Add, Edit, and Delete data...91 Introduction...91 Forms that Add Data to a Database...91 A Basic Form...91 HTML Code...92 Form Action...92 PHP Code...93 A Brief Time Out...include files...97 Forms that Display Summary Data...99 Code...100 Alan Forbes - The Joy of PHP 7

Code Explained...101 Exercise: Tweaking the SELECT...103 Improving the look of the table with CSS...104 CSS Explained...105 Modifying the form to link to the detail page...106 Forms that Display Detail Data...107 Code...108 Code Explained...109 Forms that Edit Data...110 Forms that Delete Data...110 Code to delete data...111 Code Explained...111 Exercise...112 Session Variables...113 Introduction...113 Sessions...114 Starting a PHP Session...115 Using Session Variables...115 Store a variable...115 Retrieve a variable...115 Checking for a variable...115 Destroying a Session...116 Working with Images...117 Introduction...117 Exercise: Viewing Images...119 Pulling an unknown number of images from a database...119 Exercise: Create a Database Table to store images...119 Exercise: Modify the viewcar.php page to show multiple images...120 Code explained...120 PHP File Uploads...122 Introduction...122 Create an Upload File form...122 Create a Script to Process the Uploaded File...123 Alan Forbes - The Joy of PHP 8

Code: ViewCarsAddImage.php...124 Code Explained...125 PHP Quirks and Tips...129 Introduction...129 Single Quotes vs Double Quotes...129 The Equal Sign...130 Comparison Operators...132 Security Considerations...133 Introduction...133 Balancing Security and Usability...133 SQL Injection...134 Additional Resources...136 Appendix A: Installing PHP on a Website...137 How to install on a Windows Server...137 How to install on a Linux Server...137 Alan Forbes - The Joy of PHP 9