AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
CF and JSP/Servlets Developed originally by Robi Sen For the CF UnderGround II Seminar, Apr 2001 Edited and enhanced by Charlie Arehart (Robi had an emergency.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Server-Side vs. Client-Side Scripting Languages
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
Web Programming Introduction to PHP COM Objectives To understand what PHP is and how a PHP script works with a Web Browser and a Web Server To learn.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
PHP Workshop ‹#› PHP: The Basics. PHP Workshop ‹#› What is it? PHP is a scripting language commonly used on web servers. –Stands for “PHP: Hypertext Preprocessor”
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 03.
PHP: Hypertext Processor Fred Durao
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application.
PHP == ‘ Hypertext Preprocessor ’ Open-source, server-side scripting language Used to generate dynamic web-pages PHP scripts reside between reserved PHP.
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.
CP3024 Lecture 3 Server Side Facilities. Lecture contents  Server side includes  Common gateway interface (CGI)  PHP Hypertext Preprocessor (PHP) pages.
ITD 3194 Web Application Development Chapter 4: Web Programming Language.
PHP H ypertext P re-processor. Unit 6 - PHP - Hello World! - Data types - Control structures - Operators.
University of Sunderland Lecture 1 Internet Software Architectures Lecture 1: Introduction.
PHP. Why should we learn web programming? No need write socket programming. - You can forget TCP/IP & OSI layers. - Web server handles socket tasks for.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
INTERNET APPLICATION DEVELOPMENT For More visit:
COP 3813 Intro to Internet Computing Prof. Roy Levow PHP.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Nael Alian Introduction to PHP
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
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.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
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.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
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.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
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.
Session 2: PHP Language Basics iNET Academy Open Source Web Development.
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,
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
PHP Overview. What is PHP Widely available scripting language Free Alternative to Microsoft’s ASP Runs on the Web Server; not in the browser Example:
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
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.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
PHP stands for …….. “PHP Hypertext Pre-processor” and is a server-side scripting language like ASP. PHP scripts are executed on the server PHP supports.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
PHP using MySQL Database for Web Development (part II)
PHP / MySQL Introduction
PHP Introduction.
PHP.
Intro to PHP.
PHP an introduction.
23 PHP.
Presentation transcript:

AIT 616 Fall 2002 PHP

AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs common server-side tasks  Platform independent  Similar in concept to ColdFusion and ASP  Instructions embedded with HTML template  Instructions are parsed out and processed by a special program running on the Web server  Output from the instruction are incorporated back into the HTML template and sent to the client’s browser

AIT 616 Fall 2002 PHP  A relative newcomer in the server-side development arena  Gained a large following with its simple syntax and comprehensive function library  Attractive alternative to ASP for new developers  Dubbed by some to be the ‘Perl Killer’ of the server-side scripting world

AIT 616 Fall 2002 Support Servers  Windows environment  Personal Web Server  Internet Information Server (IIS)  Apache  Unix Environment  Apache (pre-configured on linux)

AIT 616 Fall 2002 Writing PHP Code  PHP code coexists with HTML code in the same file  Must enclose PHP code with special delimiters … HTML code …. <?php … php code … ?> … HTML code …

AIT 616 Fall 2002 Writing PHP Code …. <?php echo “ Hello, World ” ?> Server-side script

AIT 616 Fall 2002 Writing PHP Code …. Hello, World Client-side source code delivered to a browser

AIT 616 Fall 2002 Writing PHP Code  Comments  Double forward slash (//)  echo command  Prints out and include a \n character  Comma  Separates commands

AIT 616 Fall 2002 PHP Variables  Stores literal values  Two types  Scalar  Holds one value  String, integer, floating  Array  Holds multiple values  Case sensitive <?php $lang=‘PHP’ $num=1 ?>

AIT 616 Fall 2002 PHP Variables  Predefined  Provides a large number to any script  Are dependent upon which server is running  Version, setup, other factors  Scope  Is the context within which it is defined  For the most part, all variables have single scope

AIT 616 Fall 2002 PHP Variables <?php $a=1 function Test() { $b=$a echo $b } ?> Global Scope Local Scope

AIT 616 Fall 2002 PHP Operators  Common mathematical functions  Concatenation  Dot (.) operator  Comparison operators  Returns true or false  Boolean arithmetic <?php $x=‘ Hello,’ $y=‘World! ’ $z=$x.$y echo $z ?> Hello, World!

AIT 616 Fall 2002 PHP Decision Structures  Decision making during course of scripting processing  if statement <?php $age=26 if($age>=18) { echo ‘Register to vote!’ } ?>

AIT 616 Fall 2002 PHP Looping Structure  Iterative execution of a set of instructions  for loop  while loop <?php $num=7 $square=$num*$num while($num<$square) { if($num%2==0) { echo ‘ $num ’ } $num=$num+1 } ?>

AIT 616 Fall 2002 PHP Functions  Performs many common tasks  Large number of built-in functions  Define your own function  Functions  Apache-specific  Database specific  Network service  Mathematical  String  PDF  File system  XML parser  Session maintenance

AIT 616 Fall 2002 PHP Header() Function  Useful built-in function  Used to add a line to the HTTP header  Functionality  Type of file being sent to client  Cookies  Redirect  Host of other bits of information

AIT 616 Fall 2002 Built-in Function <?php function myFactorial($x) { $f=1 for($k=1;$k<=$x;$k++) { $f=$f*$x; } return $f } $yourNumber=4 echo ‘factorial of $yourNumber is: ‘ echo myfactorial($yourNumber) ?>

AIT 616 Fall 2002 Common Web Tasks  Responding to a form submission  PHP engine automatically stores the form data into an associative array  Using environmental variables  Stores information about a client  Function getenv()  Sending  Function mail()  Placing a cookie  Function setcookie()  Database access

AIT 616 Fall 2002 Common Web Tasks  Implementation of basic HTTP authentication to protect resources on the server  File access on the server (r/w)  Handle file uploads from a client  Session tracking

AIT 616 Fall 2002 PHP Summary  Advantages  Fairly easy to learn  Everything is built right into the language  Cross platform  Its Free!!  Active user community  Disadvantages  Language was designed to be programmer-friendly, which unfortunately makes it a little less friendly to non-programmers

AIT 616 Fall 2002 PHP Summary  Target Developer  Web developers on a budget who enjoy simple programming  PHP gives you a great deal of power with relatively simple code structure  May not be suited to very high end applications that aren’t supported by its built-in features

AIT 616 Fall 2002 PHP vs Perl  Biggest advantage of PHP over Perl is that PHP was designed for scripting for the web  PHP is less confusing and a stricter format without losing flexibility  PHP is easier to integrate into existing HTML then Perl  PHP has pretty much all the ‘good’ functionality of Perl  Perl is a very tried and true language, its been around since the late 80s, but PHP is maturing very quickly