CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.

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.
 PHP's name is an recursive acronym for:  Hypertext Preprocessor  PHP script is an HTML- embedded scriting language  Designed to do something only.
 HTTP Communication  HTTP Communication for Web  Static  Dynamic  Dynamic Content  PHP  PHP Block  PHP Programming Style  Database  MySQL.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
The Web Warrior Guide to Web Design Technologies
Server-Side vs. Client-Side Scripting Languages
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
PHP By Dr. Syed Noman Hasany. PHP PHP was originally created by Rasmus Lerdorf in PHP stands for PHP: Hypertext Preprocessor (a recursive acronym).
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
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 WEB DATABASE PROGRAMMING
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.
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
Languages in WEB Presented by: Jenisha Kshatriya BCM SS09.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
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.
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.
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.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
הרצאה 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.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
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,
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.
CGS 3066: Web Programming and Design Spring 2016 PHP.
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)
Module 1 Introduction to JavaScript
>> Introduction to JavaScript
Introduction to Dynamic Web Programming
Chapter 6 JavaScript: Introduction to Scripting
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
PHP / MySQL Introduction
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
PHP Introduction.
Intro to PHP & Variables
ITS332.
PHP.
Intro to PHP.
Tutorial 6 PHP & MySQL Li Xu
An Introduction to JavaScript
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:

CSC 318 WEB APPLICATION DEVELOPMENT

 Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function of PHP  Why PHP?  Implementing PHP  How PHPWorks?  Requirements for PHP  How to write PHP codes

 Students will design and develop webpage using Server-Side scripting for efficient user interaction.  Students will establish, configure and maintain an intranet and internet website.  Students will understand about PHP, requirement and function of PHP.

 In a client-server application there are two kinds of scripts or program:  client-side script client side script like Client-JavaScript is run on the client computer using web browser.  server-side script server-side script like ASP,PHP, and ColdFusion is run by Web server (such as IIS Apache, etc.)

Reduce requests needed to be passed to server Access browser Enhance Web pages with DHTML, ActiveX controls, and applets Validate user input Executed on server Generate custom response for client Wide range of programmatic capabilities Access to server-side software that extends server functionality

 Faster to display since workload is distributed to user’s PC  Customizable output – personalized experience  Cannot retain global data  Cannot store data from user into database

 Data from user can be stored into database  Web server control user’s browsing selection  The processing is centralized at the server. This will put the burden of processing on the server instead of the client

 PHP  To have basic understanding of HTML, CSS and JavaScript  PHP stands for “Hypertext Preprocessor“  PHP is a widely-used, open source scripting language  PHP scripts are executed on the server  PHP is open source software and it is FREE  Current version of PHP is Version 6.

 PHP files can contain text, HTML, CSS, JavaScript, and PHP code  PHP code are executed on the server, and the result is returned to the browser as plain HTML  PHP files have extension “*.php“  In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax.  if conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, C#, Java and Perl.

PHP can restrict users to access some pages on your website PHP can add, delete, modify data in your database PHP can create, open, read, write, and close files on the server PHP can generate dynamic page content PHP collect form dataPHP can encrypt data PHP can send and receive cookies With PHP you are not limited to output HTML. You can output images, PDF files, and even Flash movies. You can also output any text, such as XHTML and XML.

 To implement PHP, you need a SERVER inside your computer – It is FREE!  Server is used to test PHP script in your computer.  PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page.  PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data

PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. PHP Scripts Web browser PHP Module Web Server (XAMPP) Send script Return output

 Install a web server – Eg. XAMPP  Install PHP – Eg. phpMyAdmin  Install a database, such as MySQL

 Install PHP MyAdmin – for database & coding platform   Look & try at the “Demo” first before download the software.  Install XAMPP – for server 

client server URL request HTML PHP Script request HTML

 PHP code is surrounded with by delimeter   <? is open section for PHP  ?> is closing section of PHP

PHP code skeleton: … First style Second style Third style

 Use PHP built in functions  Example ▪ echo ‘Hello Student’; ▪ print “ How are you”;  Case-insensitive for function names ▪ ECHO, echo, Echo  Other print functions  print_r, var_dump - value of variable  print_f - formatting what you print

 White spaces - blank lines, tabs and extra spaces To alter spacing of finished web page, use ▪ - line break ▪ - paragraph To alter spacing of HTML source from PHP, use ▪ echo() or print() over the course of several lines ▪ \n (newline character) within double quotation marks

 Important aspect to dynamic web site development  Viewable in the source but not in the browser window  PHP supports 3 type of comments # this is a comment // this is also a comment /* this is a larger comment that spans two line */

 Rules of thumb Variable name must start with dollar sign ($) Combination of strings, numbers and the underscore First character after dollar sign cannot be a number Case sensitive Assigned value using equals sign (=)

 A quoted chunk of letters, numbers, spaces, punctuation..  Example strings  ‘hello’  ‘software’  ‘1000’  ’12 January, 2006’  String variable – assign a string value to valid variable name  $today =’16 July, 2007’;  To print out  echo $today;  echo “Today is $today”;  Concatenation string  Addition of strings using period (. ). ▪ $day=‘12’; ▪ $month=‘January’; ▪ $year =‘2006’; ▪ $today = $day. ’ ‘. $month. ’ ‘. $year;  Use it extensively when building database queries in later chapters

 Valid number-type variables can be  8  3.14    Arithmetic operators  + addition  - subtraction  * multiplication  / division  % modular  ++ increment  -- decrement

 Functions  round() ▪ $j = 3.14; ▪ $k = round( $j);  number_format() ▪ $p =20980; ▪ $g=number_format($p); ▪ $g=number_format($p,2);

 Specific data type  Retain initial value throughout script  Cannot change once it has been set  Use define() ▪ define (‘AGE’, ‘value’);  Print constant ▪ echo ‘Hello, ‘. AGE; OR ▪ echo ‘Hello,’, AGE;

 Single quote-> values treated literally  Double quote-> interpolated  Example:  $var =‘Hello’;  echo “var equal to $var”; ▪ var equal to hello  echo ‘var equal to $var’; ▪ var equal to $var  echo “\$var is equal to $var”; ▪ $var is equal to hello

 “”  replace variables name with its value and a special character’s code (\$) with its represented value  ‘’  display exactly what you type, except for the escaped single quote (\’) and the escape backslash (\\).

PROGRAMMING WITH PHP

 Setup  Creating an HTML form  Handling an HTML form

Client Web-browser Client Web-browser Server Apache Server Server Apache Server URL request HTML PHP Script request HTML To open the electronic page localhost/foldername/pagename.extension Server and Database xampp [ Apache:web server, MySQL: database] Programming Languages HTML:design, JavaScript:Validation PHP:Server Side Scripting, SQL: Data manipulation Folder and Electronic Page Save the electronic page in a folder Save the folder : xampp/htdocs

 Managing HTML form with PHP involves 2 steps : 1. Step 1: Create HTML form with any text editor HTML form (.htm/.html) is created using the HTML form tags and various input types. 2. Step 2: Create PHP scripts that receives form data PHP script (.php) is created to receives the submitted form data and handle it.

Step 1: create html form Step 2: create php scripts that receive form data

how data is sent (get or post) which page the form data will be send

 If you have a text box in html form with name attribute age, PHP will store the text entered there in a variable called $age (registered global variable)  $age is similar to $_POST[‘age’] (superglobal variables)  eg : ( in HTML form)  eg : ( in PHP scripts) echo “ Thank you, {$_POST[‘age’]} for the following comments”; Age: attributes

    