Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 3 PHP (2) : Functions, User Defined Functions & Environment Variables.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
PHP Intro/Overview Squirrel Book pages Server-side Scripting Everything you need to know in one slide 1.Web server (with PHP “plug-in”) gets a.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Introduction to scripting
August Chapter 1 - Essential PHP spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
ALBERT WAVERING BOBBY SENG. Week Whatever: PHP  Announcements/questions/complaints.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
PHP Overview CS PHP PHP = PHP: Hypertext Preprocessor Server-side scripting language that may be embedded into HTML One goal is to get PHP files.
PHP == ‘ Hypertext Preprocessor ’ Open-source, server-side scripting language Used to generate dynamic web-pages PHP scripts reside between reserved PHP.
Copyright © Curt Hill PhP History and Introduction.
INTERNET APPLICATION DEVELOPMENT For More visit:
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
Nael Alian Introduction to PHP
November 2003Bent Thomsen - FIT 6-11 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Website Development with PHP and MySQL Saving Data.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Web Programming Language Week 5 Dr. Ken Cosh Introducing PHP 1.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports.
Introduction to Web Programming. Introduction to PHP What is PHP? What is a PHP File? What is MySQL? Why PHP? Where to Start?
PHP Open source language for server-side scripting Works well with many databases (e.g., MySQL) Files end in.php,.php3 or.phtml Runs on all major platforms.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Server-Side Scripting with PHP ISYS 475. PHP Manual Website
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Since you’ll need a place for the user to enter a search query. Every form must have these basic components: – The submission type defined with the method.
Fall 2004CSI University of Ottawa Introduction to PHP Basic principles and syntax.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
Creating PHP Pages Chapter 5 PHP Structure and Syntax.
FP512 WEB PROGRAMMING 1 PREPARED BY: PN. NUR SYUHADA BINTI MOHAMAD.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
Session 2: PHP Language Basics iNET Academy Open Source Web Development.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
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.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
CGS 3066: Web Programming and Design Spring 2016 PHP.
JavaScript and Ajax Week 10 Web site:
IST 210: PHP Basics IST 210: Organization of Data IST2101.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
A pache M ySQL P hp Robert Mudge Reference:
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
PHP using MySQL Database for Web Development (part II)
ASP MVP Web applications and Razor
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
PHP Introduction.
Introduction to JavaScript
A second look at JavaScript
PHP.
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Tutorial 6 PHP & MySQL Li Xu
Introduction to JavaScript
PHP Forms and Databases.
PHP an introduction.
PHP-II.
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.
Presentation transcript:

Introduction to PHP and Server Side Technology

Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004

Slide 3 General PHP Characteristics (1) PHP is made up of a PHP scripting block PHP scripting blocks can appear anywhere in a Web page In addition to PHP scripting blocks, PHP documents typically contain HTML A page having embedded PHP script must have a file suffix of.php

Slide 4 General PHP Characteristics (2) Like ASP.NET PHP is server-side technology It runs on nearly all Web servers There is an IIS version It’s open source It talks to databases MySQL and others Facebook is a PHP application

Slide 5 General PHP Characteristics (2) PHP works with XML PHP supports AJAX PHP supports cookies

Slide 6 The Basics of PHP Syntax PHP scripts always appears between PHP statements always end in a semi-colon Comments have the same format as JavaScript PHP KEYWORDS ARE NOT CASE SENSITIVE BUT VARIABLE NAMES ARE

Slide 7 A First PHP Program As in

Slide 8 PHP Variables Like JavaScript, variables are ‘loosely typed’ Variables can be declared anywhere in a PHP script Variable names Must begin with a letter or underscore ‘_’ character The remaining characters can be letters, numbers or the underscore Variables cannot contain spaces

Slide 9 PHP Variables (Declaring) Variable declarations begin with the dollar sign ‘$’, followed by the variable name An equals sign and value follow the declaration Examples: $userName = “joe”; $pi = 3.14;

Slide 10 PHP Variables (Scope) Global variables are declared outside of a function Use the global keyword to access variables from a function Local variables are declared within a function Works the same way as JavaScript

Slide 11 Using Numeric Variables (1) Arithmetic operations work similarly in PHP and JavaScript Use print or echo to write output print returns 1 while echo returns nothing Use the $ to reference all variable names $x = 10; $y = 100; print $x + $y; /* 110 */

Slide 12 Using Numeric Variables (2) The following prints because the value is quoted $x = 10; $y = 100; print "$x + $y";

Slide 13 PHP Strings (Introduction) Strings work in PHP the same way they work in other languages There are several string functions: The dot (.) is the concatenation operator

Slide 14 PHP Data Types Similar to JavaScript

Slide 15 A First Server Round Trip Using Forms (1) Remember form widgets from JavaScript and so on Remember widgets are contained in a form Widgets are visible from PHP script so we can process their contents on the server

Slide 16 A First Server Round Trip Using Forms (2) The following form posts to the page named Welcome.php ( action attribute) Name: Age:

Slide 17 A First Server Round Trip Using Forms (3) Welcome.php contains the script to process the posted data Welcome ! You are years old.

Slide 18 A First Server Round Trip Using Forms (4)

Slide 19 GET and POST (Introduction) There are two basic ways to send data back to a Web server We call these HTTP verbs In all there are about 30 verbs Both GET and POST send data to Web servers

Slide 20 HTTP GET GET sends is data through the URL itself as a query string The URL looks something like this ?fname=zaphod&age=42 ?fname=zaphod&age=42 values appear after the ? Data appears as key=value pairs A & separates each key=value pair You don’t write the URL – HTTP does!

Slide 21 HTTP POST The request data does not appear inside the query string Data is sent in the HTTP header itself It’s possible to pull this data out of the header

Slide 22 HTTP GET and POST (Comparison) GET Query strings are small (100 characters) Posted data is visible It’s possible to bookmark the page PUT Large data blocks can be posted Posted data is hidden Page cannot be bookmarked

Slide 23 Reading Posted Data $_GET and $_POST retrieve data send to the server via a GET or POST, respectively They are built-in functions Pass the ID of the input control as an argument

Slide 24 Example Welcome ! You are years old.

Slide 25 PHP Functions (Introduction) PHP has built-in functions just like any language In all, there are about 700 so we will not get to all of them Refer to for a categorized list

Slide 26 PHP Functions (Syntax) It all looks just about like JavaScript (except the $ notation for variables) Functions and accept 0, 1 or many arguments Functions and return a value Again, the arguments are loosely typed

Slide 27 Declaring a PHP Function (Example) Declare a function named ShowFooter <?php function ShowFooter() { print(" "); print(“Rendered ". date("y-m-d")); print(" "); } ?>

Slide 28 Calling a Function (Example) Call the ShowFooter function shown previously