PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
IST 221 Internet Concepts and Applications Introduction to PHP.
PHP Intro/Overview Squirrel Book pages Server-side Scripting Everything you need to know in one slide 1.Web server (with PHP “plug-in”) gets a.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  Originally Personal Home Page  PHP is interpreted  PHP code is embedded.
Scripting Languages and PHP. Origins Rasmus Lerdorf ‘Personal Home Pages’. Zeev Surashi and Andi Gutmans Open Source PHP version 4 Full information on.
Server side basics.
PHP: Introduction By Trevor Adams.
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”
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 Processor Fred Durao
August Chapter 1 - Essential PHP spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
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.
PHP MOHAMMED SHURRAB TO MISS/ RASHA ATTALLAH. What is PHP? Stands for "PHP Hypertext Preprocessor" Server-side scripting language HTML-embedded Supports.
PHP == ‘ Hypertext Preprocessor ’ Open-source, server-side scripting language Used to generate dynamic web-pages PHP scripts reside between reserved PHP.
CSC 405: Web Application And Engineering II 2.1 Web Programming with PHP Introduction to Web programming Introduction to Web programming The programming.
PHP H ypertext P re-processor. Unit 6 - PHP - Hello World! - Data types - Control structures - Operators.
Lecture 12 PHP Basics Boriana Koleva Room: C54
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
INTERNET APPLICATION DEVELOPMENT For More visit:
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
School of Computing and Information Systems CS 371 Web Application Programming PHP - Basics Serving up web pages.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
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.
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.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
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 PHP: Hypertext Preprocesor Personal Home Page Tools.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
PHP Arūnas Liuiza. PHP 101 What is PHP? Widely popular dynamic interpreted opensource programming language, aimed for web development Syntax is simmilar.
PHP - 1h. How it works Client requests document Server loads document in memory Server processes document with relevant module (PHP) Server sends XHTML.
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.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
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 Workshop ‹#› أطلق إبداعك 2 أطلق إبداعك 2 مدرس معتمد من مركز زووم PHP: The Basics.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
CSC 405: Web Application Engineering II 2.1 Web Programming with PHP Introduction to Web programming Introduction to Web programming The programming language.
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.
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,
CSE 154 LECTURE 14: INTRO TO PHP. URLs and web servers usually when you type a URL in your browser: your computer looks up the.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
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.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 13 Scott Marino.
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)
CS 371 Web Application Programming
CHAPTER 5 SERVER SIDE SCRIPTING
DBW - PHP DBW2017.
PHP (PHP: Hypertext Preprocessor)
PHP Introduction.
JavaScript an introduction.
PHP.
Web DB Programming: PHP
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
PHP: Hypertext Preprocessor
PHP an introduction.
23 PHP.
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Presentation transcript:

PHP Server-side Programming

PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter is built into the web server  Syntax is similar to C, Java, Perl  PHP is open source, free, available for most platforms, popular

What can you do with PHP  Generate content as an HTML page is loaded (generate HTML code)  Respond to a form with dynamic content  Retrieve and display information from a database

Where does the PHP code go?  PHP code goes into a special element type in your HTML files.  You can have multiple php elements in a page  Code in the php element is sent to the php interpreter; everything else is assumed to be content

HelloWorld in PHP PHP

Here Documents  Instead of using multiple print statements, use a here document print <<<_HTML_ … _HTML_  Everything between the two _HTML_ is printed

Getting Dynamic Content from a Form  Displaying form Your Name:  PHP program that responds to form <?php print "Hello, "; // Print what was submitted in the form parameter called 'user' print $_POST['user']; print "!"; ?>

Basics  Syntax is similar to C and perl  // /* */ and # for comments  Statements are terminated by semicolon  Whitespace insensitive  Keywords are case-insensitive

More Basics  Variable names same as for Java with a $ in front  can be assigned by value or by reference  Untyped  Use printf for output  Just like in C

Built-In Types  Primitive  boolean  integer  float  string  Compound  array (similar to hash in perl)  object - defined by a class  Special types  NULL  resource

Strings  Use either double or single quotes for strings  Use \ as an escape character  Strings can extend over multiple lines  Variable expansion will occur in double- quoted strings

String functions  trim removes leading and trailing whitespace  strlen gives number of characters in the string  == can be used to compare strings (case sensitive)  strcasecmp() compares strings ignoring case (semantics of C strcmp)  Use. for concatenation  get substrings using substr( string, start, length)

Numbers  PHP distinguishes between integer and floating point values  Usual set of arithmetic operations and assignment operators  integer division can give floating point result  Usual set of mathematical functions  Other functions for things like formatting, type conversion, …

Booleans  False values are 0, 0.0, "0", "", false, NULL, array with 0 elements, object with 0 member variables  everything else is true  Usual set of comparison operators ( = >)  work with strings  Usual set of logical operators (! && ||)

Control Statements  Selection if ( cond) { … } elseif (cond2) { …} … else { … }  also switch  Loops while (cond) { … } do { … } while( cond); for (init; cond; update) { … } foreach() { … }

Coming later  Arrays  Objects  Functions  Interacting with the OS  Form processing  Using databases

Sources  Learning PHP 5 by David Sklar  Programming PHP by Rasmus Ledorf and Kevin Tatroe  PHP home page 