Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.

Slides:



Advertisements
Similar presentations
IS 6116 Introduction – 10 Jan Lecturer Details Aonghus Sugrue Website: aonghussugrue.wordpress.com
Advertisements

PHP I.
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
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.
Multiple Tiers in Action
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
Server side basics.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Web Programming with PHP (1). -Computer programming (often shortened to programming or coding) is the process of writing, testing, debugging/troubleshooting,
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.
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.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
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.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
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.
INTERNET APPLICATION DEVELOPMENT For More visit:
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
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.
Introduction to PHP “PHP is a server-side scripting language designed specifically for the Web. Within an HTML page, you can embed PHP code that will be.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
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.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
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.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
PHP Workshop ‹#› أطلق إبداعك 2 أطلق إبداعك 2 مدرس معتمد من مركز زووم PHP: The Basics.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
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.
PHP Form Processing * referenced from
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,
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
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.
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.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
PHP using MySQL Database for Web Development (part II)
Introduction to Dynamic Web Programming
PHP / MySQL Introduction
PHP Introduction.
PHP.
Web DB Programming: PHP
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
IntroductionToPHP Static vs. Dynamic websites
Intro to PHP.
Tutorial 6 PHP & MySQL Li Xu
PHP an introduction.
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.
Web Application Development Using PHP
Presentation transcript:

Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access

Static vs Dynamic  Most of web sites we use nowadays  The client asks the server for a web page  The server creates the page specially for the client  The server sends the page that has been generated  Dynamic web pages are made by (X)HTML, CSS PHP and MySQL Show case web sites Show case web sites The client asks the server for a web page The client asks the server for a web page The server answers back by sending the web page The server answers back by sending the web page Static web pages are made by (X)HTML & CSS Static web pages are made by (X)HTML & CSS StaticDynamic

Your project  Server: using MySQL  Client: using PHP  Connect MySQL with PHP:  es/B561-fall13/webpage/phpmysql.html es/B561-fall13/webpage/phpmysql.html

How PHP Works  1. User request  2. The request goes to web server  3. The request goes to PHP interpreter  4. The request is interpreted by PHP interpreter  5. PHP interpreter process the page by communicating with file system, databases and servers  6. Deliver a web page to web server to return to the user browser

PHP: Hypertext Preprocessor  PHP is the Hypertext Preprocessor Script language Embedded into HTML Run as Apache module Can use DB (MySQL, Oracle, Microsoft SQL, PostgreSQL) Rich features: XML, PDF etc.,

Advantages of PHP  Free  Pre-installed in Linux distributions  Open Source  Multiplatform  Simple, easy to learn and use  Procedural language Compare with JavaScript which is event-driven  C-like syntax - { } ;  Extensive Function Library  Good Web-server integration Script embedded in HTML Easy access to form data and output of HTML pages  Not fully object-oriented Java is fully object oriented – all functions have to be in a class In PHP, classes are additional but quite simple to use

Architecture PHP script Web Server (Apache, IIS) Browser (IE, FireFox, Opera) Desktop (PC or MAC) Database Server SQLHTTP HTMLtablesvision touch

PHP: Variables, constant, operators and Control structures Variable Variable $var = 123; $var = 123; Constant Constant define(“Zipcode", 40508); define(“Zipcode", 40508); Operators Operators Assignment (e.g. =, +=, *=) Assignment (e.g. =, +=, *=) Arithmetic (e.g. +, -, *) Arithmetic (e.g. +, -, *) Comparison (e.g., >=, ==) Comparison (e.g., >=, ==) Logical (e.g. !, &&, ||) Logical (e.g. !, &&, ||) Control Structures Control Structures Conditional (branching) structures (e.g. if/else) Conditional (branching) structures (e.g. if/else) Repetition structures (e.g. while loops). Repetition structures (e.g. while loops).

Datatypes Boolean Boolean true true false false Integer Integer x34 0x34 Floating point Floating point Array Array array(“lexington", “hanoi", "london") array(“lexington", “hanoi", "london") array(“kentucky" => “lexington", "vietnam" => "hanoi", "england" => "london") array(“kentucky" => “lexington", "vietnam" => "hanoi", "england" => "london") $a[2] $a[2] $a["vietnam"] $a["vietnam"]

String Data type A string is a sequence of chars $stringTest = “this is a sequence of chars”; echo $stringTest[0]; //output: t echo $stringTest; //output: this is a sequence of chars A single quoted strings is displayed “as-is” $age = 37; $stringTest = 'I am $age years old'; // output: I am $age years old $stringTest = “I am $age years old”; // output: I am 37 years old Concatenation $conc = ”is “.”a “.”composed “.”string”; echo $conc; // output: is a composed string $newConc = 'Also $conc '.$conc; echo $newConc; // output: Also $conc is a composed string

Example <?php PHP CODE GOES IN HERE ?>  IP address: (Need to be in UK network to access)

FORM Handling GET GET $_GET['name'] $_GET['name'] POST POST $_POST['name'] $_POST['name']

FORM Handling Example Name: Age: … <? Hello. You are years old. ?> test.php HTML FORM name: age: submit Kausalya 22 PHP Hello Kausalya. You are 22 years old.

Example(2) – Loop manipulations

Output

While Loops

Arrays and Functions

Output

Returning Values from Functions

New Output

Including Files  Simple use the include keyword and use the path to the file you wish to include.  Step 1: Create the file you wish to include. This example holds navigational links.

Step 2: Include the File in Code

New, Consistent Output

Function 1 (No Parameters)

Output (Function 1)

Function 2 (Pass by Value)

Output (Function 2)

Function 3 (Pass by Reference)

Output (Function 3)

How to connect PHP with MySQL  es/B561-fall13/webpage/phpmysql.html es/B561-fall13/webpage/phpmysql.html  This tutorial introduces how to use PHP and MySQL in a LINUX environment. You may choose to host the server and client on our department machines or your laptop.

References Websites csmaster.sxu.edu/appel/web  Books PHP and MySQL Web Development 2 nd Edition, Welling & Thomson Web Database Applications with PHP & MySQL, O’Reilly Publishers PHP Cookbook, O’Reilly Publishers MySQL Cookbook, O’Reilly Publishers “PHP and MySQL Web Development”, Luke Welling and Laura Thomson, SA  Listservs thelist, (Note: very general and large volume of )