PHP - Introduction Week 5 Dr. Ken Cosh Introducing PHP 1.

Slides:



Advertisements
Similar presentations
SWU, Computer systems and technologies. The Objective of This Lecture To give you a very high-level overview of some of the tools for Web Programming.
Advertisements

XAMPP: Cross – Apache, MySQL, Php, Perl + FileZilla, Tomcat NetBeans: IDE PHP Installation.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic PHP.
Introduction to PHP (Part-1) Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
PHP By Dr. Syed Noman Hasany. PHP PHP was originally created by Rasmus Lerdorf in PHP stands for PHP: Hypertext Preprocessor (a recursive acronym).
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.
PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application.
Outline o What is an array ? o Indexed array o Associative array o Multidimensional array.
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.
By Luo Xuan. Some may have learned “PHP: Hypertext Preprocessor” , 超文本预处理语言 Personal Home Page Tools (PHP Tools) ——Rasmus Lerdorf a widely used open-source.
04/09/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
Programming with php By: Seth Larson. A little bit about PHP  PHP stands for PHP:  Hypertext Preprocessor  PHP is a widely-used general-purpose server-side.
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.
INTERNET APPLICATION DEVELOPMENT For More visit:
Mandakini Ayushi Infotech Mandakini Kumari 22 nd July PHP Basic.
PHP - Hypertext Preprocessor. Introduction PHP is a powerful server-side scripting language for creating dynamic and interactive websites. PHP is a powerful.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
INTERNET APPLICATION DEVELOPMENT For More visit:
PHP Arrays. Outline o What is array in PHP ? o Numeric array o Associative array o Multidimensional array.
Nael Alian Introduction to PHP
Open Source Software Unit – 3 Presented By Mr. R.Aravindhan.
PHP OVERVIEW. C ONTENT Introduction of PHP History and development Basics of PHP programming.
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.
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.
Julian Springer Room 42 Joe Slovo.  W3 schools recommend that you have a basic understanding of HTML and of JavaScript before attempting to grasp PHP.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
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.
PHP Constructs Advance Database Management Systems Lab no.3.
Week 4 PHP H ypertext P reprocessor Reference : Official Site :
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
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.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
PHP Variables.  Variables are "containers" for storing information. How to Declare PHP Variables  In PHP, a variable starts with the $ sign, followed.
PHP OVERVIEW. C ONTENT Introduction of PHP History and development Basics of PHP programming.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
FP512 WEB PROGRAMMING 1 PREPARED BY: PN. NUR SYUHADA BINTI MOHAMAD.
Chapter 3 Introduction to PHP. Incorporating PHP Within HTML By default, PHP documents end with the extension.php files ending with.htm or.html to also.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
Session 2: PHP Language Basics iNET Academy Open Source Web Development.
 An array stores multiple values in one single variable.  Example: Output: I like Honda Civic, BMW and Toyota.
Introduction to PHP 1.What is PHP? What Is PHP?  php: hypertext preprocessor  Server-side scripting language—like ASP—scripts are executed on server.
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,
11 – Introduction to PHP(1) Informatics Department Parahyangan Catholic University.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
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.
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:
Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this.
PHP using MySQL Database for Web Development (part II)
เอกสารประกอบการบรรยายรายวิชา Web Technology
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
8th Semester, Batch 2008 Department of Computer Science SSUET.
PHP Introduction.
Basic PHP Lecture by Nutthapat Keawrattanapat
Web Systems Development (CSC-215)
PHP.
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Basics (Cont...).
Web Programming Language
Tutorial 6 PHP & MySQL Li Xu
PHP an introduction.
PHP PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
23 PHP.
Presentation transcript:

PHP - Introduction Week 5 Dr. Ken Cosh Introducing PHP 1

Introduction PHP : Hypertext Preprocessor Server-side script language Supported by Apache/IIS on various platform (MS/Linux/Mac OS) Opensource (PHP License v3.01) 2

Introduction – cont. Extension:.php File content Html code PHP code 3 HTML

Installation LAMP (or MAMP, or WAMP…) Testing Create a file and named it “test.php” The content is “ ” 4

Outline PHP Structure Comments, Syntax, Variables Operators Conditionals Looping 5

Basic Syntax Script blockings start with Can be anywhere in the code It can be Inside the block are html-code, php-code, or text Comment the code by // or /* */ as in C 6

Basic Syntax Put the script in test.php <?php echo “hello, world”; ?> 7

Variables One type, just variables Can store numbers, strings, or array Conversion between type is automatically done. Variables begin with $, e.g. $var1 = 1; or $var2 = “alice”; No declaration is required. 8

Variables Naming rules Begins with letter or _ (after $) Contains only A-Z, a-z, 0-9, and _ 9

Variables - Array 10  Numeric  $cars=array("Saab","Volvo","BMW","Toyota");  $cars[0]="Saab";  $cars[1]="Volvo";  $cars[2]="BMW";  $cars[3]="Toyota";

Variables - Array 11  Associative  $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34);  Or  $ages['Peter'] = "32";  $ages['Quagmire'] = "30";  $ages['Joe'] = "34";  Example, <?php $ages['Peter'] = "32"; $ages['Quagmire'] = "30"; $ages['Joe'] = "34"; echo "Peter is ". $ages['Peter']. " years old."; ?>

Strings Functions Concatenate:. Length: strlen() Search/Position: strpos(text, pattern) More information:

Strings Put the script in test2.php <?php $h1 = “hello”; $h2 = “world”; echo $h1.”, “.$h2.” ”; echo “h1 has: “.strlen($h1).” letters in it ”; ?> 13

Operators - Arithmetic 14

Operators - Assignment 15

Operators - Comparison 16

Operators - Logical 17

Control Flow if/while/do…while/for All the same as C. for each Syntax foreach ($array as $value) { code to be executed; } 18

Control Flow Example <?php $x=array("one","two","three"); foreach ($x as $value) { echo $value. " "; } ?> 19

Form Put the script in test_form.php Name: Age: 20

Form Put the script in welcome.php Welcome ! You are years old. 21

Form Get, put the script in test_form.php Name: Age: 22

Form Get Visibility Though, it can be bookmarked Not suitable for large variables (>2000 characters) 23