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.

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.
Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Web Applications in Hatch Radoslav Georgiev Telerik Corporation
HTML Form Processing Learning Web Design – Chapter 9, pp Squirrel Book – Chapter 11, pp
Multiple Tiers in Action
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
PHP By Dr. Syed Noman Hasany. PHP PHP was originally created by Rasmus Lerdorf in PHP stands for PHP: Hypertext Preprocessor (a recursive acronym).
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
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 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.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, October 18, 2012 Session 7: PHP.
PHP - Hypertext Preprocessor. Introduction PHP is a powerful server-side scripting language for creating dynamic and interactive websites. PHP is a powerful.
SCV1223 PHP - Hypertext Preprocessor. Introduction PHP is a powerful server-side scripting language for creating dynamic and interactive websites. PHP.
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
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.
School of Computing and Information Systems CS 371 Web Application Programming PHP - Basics Serving up web pages.
Nael Alian Introduction to PHP
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
PHP - Introduction Week 5 Dr. Ken Cosh Introducing PHP 1.
Website Development with PHP and MySQL Saving Data.
Chapter 6 Server-side Programming: Java Servlets
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Web Programming Language Week 5 Dr. Ken Cosh Introducing PHP 1.
PHP Teresa Worner. What is it? PHP: Hypertext Preprocessor server-side scripting language open source cross-platform compatible with almost all servers.php.php3.phtml.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
PHP. 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.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
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?
CSE 154 LECTURE 5: INTRO TO PHP. URLs and web servers usually when you type a URL in your browser: your computer looks up the.
Introduction to PHP.
הרצאה 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.
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
Introduction to PHP Brendan Knight. What is PHP PHP is a general-purpose scripting language originally designed for web development to produce dynamic.
 A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests.
Creating PHP Pages Chapter 5 PHP Structure and Syntax.
PHP Security Ryan Dunn Jason Pack. Outline PHP Overview PHP Overview Common Security Issues Common Security Issues Advanced Security Issues Advanced Security.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
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.
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.
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,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
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.
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.
1 Server Side scripting PHP. 2 What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are.
A pache M ySQL P hp Robert Mudge Reference:
PHP using MySQL Database for Web Development (part II)
CGS 3066: Web Programming and Design Spring 2017
Introduction to Dynamic Web Programming
เอกสารประกอบการบรรยายรายวิชา Web Technology
DBW - PHP DBW2017.
Introduction to Web programming
PHP Introduction.
Tutorial 6 PHP & MySQL Li Xu
PHP Forms and Databases.
PHP an introduction.
PHP-II.
Presentation transcript:

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 and servers Used to develop MediaWiki, Drupal, Wordpress, Moodle

example.php Hello World

How it works Embed directly into html code (anywhere) – Delimit script with – Can also use … Server-side scripting – PHP typically installed as an Apache module – Executes within Apache – then ships html to browser Can also be installed as CGI – but slower that way More stable than Perl Apache module

PHP Syntax Must end in.php (or workaround) Comments: /* */ for blocks; // or # for one line Lines must end in ; Output html using echo or print Variables start with $ – Case sensitive – Loosely typed (don’t need to declare before adding a value to it; type not specified in advance) Functions & class names not case sensitive

Concatenation example "; $txt2="What a nice day!"; echo ($txt1. $txt2); ?> Hello World! What a nice day!

PHP arrays (numeric) Set up using array function: $student=array(“Joe”, 1234, “C”); …or just by direct assignment: $student[] = “Joe”; $student[] = 1234; $student[] = “C”; Then print “$student[2]”; gives?…

PHP arrays (associative) $student=array(name=>“Joe”, idNum=>1234, grade=>“C”); OR $student[‘name’] = “Joe”; $student[‘idNum’] = 1234; $student[‘grade’] = “C”; echo “Joe is getting a “. $student[“grade”]; Can nest arrays too.

Superglobal Arrays $_SERVER (data about current running server) $_ENV (data about client’s environment) $_GET (data sent via ‘get’ request) $_POST (data sent via ‘post’ request) $_COOKIE (data contained in cookies on the client’s computer) $GLOBALS (array containing all global variables)

GET vs POST GET Query string Limited in size Reuse query (e.g., bookmark search) Not secure POST In HTTP body Larger size limit Not secure

Form Handling Any form element in an HTML page is automatically available to PHP scripts!

Cookies Created using name, value pairs: – setcookie(“Name”, $Name, time() + seconds); – Put into header, so do this call first in script Now, future requests to server will have this data in the $_COOKIE environment variable array We’ll talk more about this in later weeks