COP 3813 Intro to Internet Computing Prof. Roy Levow PHP.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
Learning Web development. 3(+1) Tier architecture PHP script Remote services Web Server (Apache, IIS) Browser (IE, FireFox, Opera) Desktop (PC or MAC)
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Tutorial 10 Programming with JavaScript
ASP.NET Programming with C# and SQL Server First Edition
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.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
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”
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Introduction to PHP. PHP PHP is the Hypertext Pre-processor –Script language –Embedded into HTML –Runs as Apache module –Can use DB (MySQL, Oracle, Microsoft.
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.
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.
PHP H ypertext P re-processor. Unit 6 - PHP - Hello World! - Data types - Control structures - Operators.
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
INTERNET APPLICATION DEVELOPMENT For More visit:
Nael Alian Introduction to PHP
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Web Design and Development for E-Business By Jensen J. Zhao Copyright 2003 Prentice Hall, Inc. Web Design and Development for E-Business Jensen J. Zhao.
Variables, Operators and Data Types. By Shyam Gurram.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
November 2003Bent Thomsen - FIT 6-11 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
PHP By Sergio Rodriguez By Sergio Rodriguez. PHP G PHP: Hypertext Preprocessor G Scripting language G PHP: Hypertext Preprocessor G Scripting language.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
Open Source Software Unit – 3 Presented By Mr. R.Aravindhan.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
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.
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.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
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.
 2008 Pearson Education, Inc. All rights reserved PHP.
Introduction to PHP.
Web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across.
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.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Creating PHP Pages Chapter 6 PHP Variables, Constants and Operators.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 4 JavaScript.
PHP Workshop ‹#› أطلق إبداعك 2 أطلق إبداعك 2 مدرس معتمد من مركز زووم PHP: The Basics.
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.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
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.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
PHP – PHP Hypertext Processor A quick overview. How is PHP used? Embedded with HTML, e.g. Not like CGI: PHP files not an executable Used with servers.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
PHP using MySQL Database for Web Development (part II)
Tutorial 10 Programming with JavaScript
DBW - PHP DBW2017.
PHP (PHP: Hypertext Preprocessor)
Chapter 19 PHP Part II Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
PHP Introduction.
WEB PROGRAMMING JavaScript.
PHP.
Web DB Programming: PHP
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Tutorial 10 Programming with JavaScript
Intro to PHP.
Tutorial 10: Programming with javascript
PHP an introduction.
23 PHP.
Presentation transcript:

COP 3813 Intro to Internet Computing Prof. Roy Levow PHP

PHP  PHP: Hypertext Processor  Server-side scripting –Script embedded in html –Script runs on server –Allows secure access to resources on server – database, file, etc. –Hides program code from users –But, more network traffic –Standard extension is.php

Basic Format …

PHP File Form  Script is embedded in HTML  Bounded by and  Bounded by  Output replaces script code in page sent to client

PHP Service  Must be installed on server  Enabled in web server  Versions for –Apache and IIS –No many platforms  Primary site for PHP

Free PHP Services  A number of sites offer limited free PHP services  The following site lists several ting.php ting.php ting.php

Your PHP Work  You need a place to work with PHP  You may do any of the following provided that the hosting site is publicly accessible –Set up PHP on your own server –Subscribe to a free hosting site –Use any other hosting site

Language Resources  Online PHP Manual  Tutorials – – –Google for many others

Variables  Names begin with $ followed by string of letters and digits  Case sensitive  No declarations  Type determined by value $num = 5; $myName = “Prof. Levow”

Named Constants  define(“ONE”, 1); –do not have $ –must be scalars

Types  int, integer  fload, double  string //enclosed in ‘ or “  bool, Boolean //true or false  array //actually a map  object // for O-O programming  NULL //no value

Constants  Typical rules for numbers and strings  Usual \ escapes in strings  settype($var, “type”) –function to change type of a value –actually changes type of stored value  (type) expr –typical “C” cast of value  Example: Fig. 26.3, data.php

Operators  Comparable to C operators  Usual operators –arithmetic –comparison –logical –increment and decrement  op=

String Operators . for concatenation  variable interpolation with “ “ –embedded variable reference is replaced by value –example: “My name is $name.”  numeric valued strings converted for arithmetic –7 + “3” yields 10

Regular Expressions  Pattern matching in strings –ereg, eregi  (reg_exp, $search, $match) –Meta characters: * + ? ^ $. –Character class [list]  a-z  :alpha:, :alnum:, :digit:, :space:, :lower:, :upper: –Repetition: {n}, {m,n}, {,n}

Environment  Server and Client Side –$_SERVER –$_ENV –$_GET –$_POST –$_COOKIE –$GLOBALS

Form Processing  Examples: –fig form.html –fig form.php  Login –Example:  fig password.html  fig password.php

PHP Examples  Cookies –fig cookies.html –fig readCookie.php  PHP and Database connectivity