BOF #2 – Introduction to PHP and MySQL

Slides:



Advertisements
Similar presentations
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
Advertisements

Housing and Dining Online by Andrew Gorges. Outline  Overview of PHP  Overview of MySQL  Using PHP  Using MySQL  PHP and MySQL together  Production.
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
PRACTICAL PHP AND MYSQL WALKTHROUGH USING SAMPLE CODES – MAX NG.
1 The World Wide Web Architectural Overview Static Web Documents Dynamic Web Documents HTTP – The HyperText Transfer Protocol Performance Enhancements.
Creating your website Using Plain HTML. What is HTML? ► Web pages are authored in HyperText Markup Language (HTML) ► Plain text is marked up with tags,
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
With your friendly Web Developer, Chris.. Terminology  HTML - > Hypertext Markup Language  CSS -> Cascading Style Sheet  open tag  close tag  HTTP->Hypertext.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
CHAPTER 7 Form & PHP. Introduction All of the following examples in this section will require two web pages. The first page retrieves information posted.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Fermi National Accelerator Laboratory Benedict College Akuako Kalu Benedict College, Columbia, SC Junior Computer Science A WEB BASED ACCELERATOR CATALOGUE.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
How Web Database Architectures Work CPS181s April 8, 2003.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Overview Web Technologies Computing Science Thompson Rivers University.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 8 – Review Reference:
PHP – Hypertext Preprocessor.
Communication protocols 2. HTTP Hypertext Transfer Protocol, is the protocol of World Wide Web (www) Client web browser Web server Request files Respond.
National College of Science & Information Technology.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
PHP using MySQL Database for Web Development (part II)
CGS 3066: Web Programming and Design Spring 2017
Web Programming Language
Web Technologies Computing Science Thompson Rivers University
State Management Cookies, Sessions SoftUni Team State Management
Introduction to Dynamic Web Programming
Section 6.3 Server-side Scripting
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
Web Development Web Servers.
Introduction to PHP FdSc Module 109 Server side scripting and
Development of Web Applications – Introduction revisited
Lecture 11. Web Standards Continued
PHP –MySQL Interview Question And Answer.
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Web Software Model CS 4640 Programming Languages for Web Applications
CASE STUDY -HTML,URLs,HTTP
Cookies and Sessions Charles Severance
PHP / MySQL Introduction
PHP Introduction.
Department of Computer Science, Florida State University
ISC440: Web Programming 2 Server-side Scripting PHP 3
Chapter 27 WWW and HTTP.
Web Systems Development (CSC-215)
Software Engineering for Internet Applications
IntroductionToPHP Static vs. Dynamic websites
Web Programming Language
Intro to PHP.
J2EE Lecture 1:Servlet and JSP
Introduction to World Wide Web

BOF #1 – Fundamentals of the Web
Web Technologies Computing Science Thompson Rivers University
[Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU]
Hypertext Preprocessor
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
HTTP and HTML HTML HTTP HTTP – Standardize the packaging
[Based in part on SWE 432 and SWE 632 materials by Jeff Offutt, GMU]
Web Application Development Using PHP
Presentation transcript:

BOF #2 – Introduction to PHP and MySQL Bootup Open Forums CTO-level technical introduction to key technology Interactive throughout – relevant Q&A will drive content Laptops welcome although not required (not yet) Semi-weekly – recommend topics yourself Community involved - lead a BOF yourself

Introduction to PHP and MySQL The Dynamic Duo for a Dynamic Web BOF #2 April 12th, 2010 Hans Zaunere, Managing Member 5/4/2019

Overview The Cast and Key Concepts HTTP The Request The Process The Database Putting it All Together 5/4/2019

HTTP, Apache, MySQL and PHP The Cast HTTP, Apache, MySQL and PHP Key concept: client – server model This exchange is the request-response cycle HTTP – Protocol used to communicate Apache – The web server MySQL – Provides content/data to display PHP – PHP Hypertext Preprocessor within Apache AMP: Acronym for three key software components Basis of modern, dynamic, web/internet applications Apache Provides the transit MySQL Provides the data PHP Provides the processing – the “glue” 5/4/2019

HyperText-Transfer-Protocol HTTP HyperText-Transfer-Protocol Key concept: stateless After request-response cycle is over, neither knows of each other One of the issues of security or “hi-jacking” Cookies are utilized to maintain a session Server keeps knowledge that a client existed, identified by a cookie left on the browser For such things as knowing whether a user is logged in or not Different types of requests GET – includes optional query string – read-only POST – can also include query string – write or read HyperText Transfer Protocol Secure – HTTPS Encrypts the communication channel through a SSL certificate 5/4/2019

The Request Telling PHP What To Do PHP is designed to handle HTTP communication Apache module (other options are available) Embedded into HTML using <?php and ?> tags Provides “super-globals” for accessing information about the request $_GET – GET query string variables $_POST – POST variables $_COOKIE – Other cookie variables $_SESSION – Internal session information using a session ID 5/4/2019

The Process HTML – The “Goods” PHP is designed to process hypertext HTML is the HyperText Markup Language, used for giving structure to the information exchanged on the WWW REQUEST: HTTP/1.1 GET /my-script.php?FirstName=David RESPONSE: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"....> <html> <head> <title>Hello World</title> </head> <body> <b> <?php echo "Hello There ".$_GET['FirstName']; ?> </b> <?php echo 'At the tone, the time will be: '.date('r'); ?> </body> </html> Browser then receives and renders the HTML Doesn’t know that it’s been generated dynamically 5/4/2019

The Database SQL – The “Supplier” Data is stored in tables and columns PHP is designed to communicate with databases SQL is the Structured Query Language, used for manipulating and retrieving data SQL is also used for complex or “relational” data SELECT FirstName,LastName, DATE_FORMAT(DoB,'%M, %D, %Y') AS DateOfBirth FROM Users WHERE STRTOUPPER(LEFT(FirstName,1)) = 'H' SELECT FirstName,LastName,Address1,Address2 FROM Users,Address WHERE R_UserID=UserID AND STRTOUPPER(LEFT(FirstName,1)) = 'H' 5/4/2019

Putting It All Together Your Cast and Crew – Apache / MySQL / PHP Web browser uses HTTP to make web server request Web server passes control to PHP PHP uses SQL to query the database and fetch data REQUEST: HTTP/1.1 GET /my-script.php?FirstNameFirstLetter=H <?php $FirstNameFirstLetter = mysql_escape_string($_GET['FirstNameFirstLetter']); $Result = mysql_query("SELECT FirstName,LastName, DATE_FORMAT(DoB,'%M, %D, %Y') AS DateOfBirth FROM Users WHERE STRTOUPPER(LEFT(FirstName,1)) = '{$FirstNameFirstLetter}'",$MYDBR); $ResultCount = mysql_num_rows($Result); $ResultArray = array(); for( $i = 0; $i < $ResultCount; ++$i ) { $ResultArray[$i] = mysql_fetch_assoc($Result); } ?> 5/4/2019

Putting It All Together The Finale PHP manipulates returned data and processes HTML PHP and the web server use HTTP to respond Web browser receives HTML and displays the results <!DOCTYPE...> <ul> <?php foreach( $ResultArray as $Key => $Row ): ?> <li><?=$Row['LastName']?>, <?=$Row['FirstName']?> (<?=$Row['DateOfBirth']?>)</li> <?php endforeach; ?> </ul> 5/4/2019

New York PHP Mailing Lists are free and available to anyone: Thank You hans.zaunere@nyphp.com New York PHP Mailing Lists are free and available to anyone: http://www.nyphp.org/mailinglists.php 5/4/2019