ITM352 PHP and Dynamic Web Pages: Server Side Processing.

Slides:



Advertisements
Similar presentations
E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1 CGICGI Common Gateway Interface Server-side Programming Lecture.
Introduction to JavaScript
BY: ALBERTO CABEZAS 4/19/2010. INTRODUCTION: PHP is considered today as one of the most famous scripting languages. PHP is widely used as a general purpose.
Server-Side vs. Client-Side Scripting Languages
Chapter Concepts Review Markup Languages
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Multiple Tiers in Action
DT228/3 Web Development JSP: Directives and Scripting elements.
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Lecture 4B: Server-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
E-Commerce The technical side. LAMP Linux Linux Apache Apache MySQL MySQL PHP PHP All Open Source and free packages. Can be installed and run on most.
Inline, Internal, and External FIle
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
PHP and MySQL Week#1  Course Plan.  Introduction to Dynamic Web Content.  Setting Up Development Server Eng. Mohamed Ahmed Black 1.
The PHP Story. PHP Story PHP is a programming language. Incorporate(join) sophisticated business logic. Widely used general purpose scripting language.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 03.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
1 3. Computing System Fundamentals 3.1 Language Translators.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
1 Welcome to CSC 301 Web Programming Charles Frank.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
JAVA SERVER PAGES -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
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,
IN THIS LESSON WE WILL REVIEW THE STRUCTURE OF THE INTERNET AND HOW BROWSERS ASSEMBLE WEBSITES BASED ON INSTRUCTIONS THEY RECEIVE FROM SERVERS. Internet.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
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 Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
Top 8 Best Programming Languages To Learn
Javascript and Dynamic Web Pages: Client Side Processing
ITM352 PHP and Dynamic Web Pages: Server Side Processing 1.
Chapter 5 Scripting Language
Introduction and Principles
Lecture 11. Web Standards Continued
Chapter 5 Scripting Language
Web Application Development Using PHP
Presentation transcript:

ITM352 PHP and Dynamic Web Pages: Server Side Processing

Today's Class What is PHP? Diving in head first! –How PHP enables server side dynamic web pages –Starting to figure out what application programming is about… Have confidence that you will learn! Just keep at it.

What is PHP? A web-based programming language – "Pre-Hypertext Processor" or “PHP- Hypertext Processor” (although it originally meant “Personal Home Page”) - All computers are directed by programs - like very detailed recipes - written in languages that humans can understand and be processed by computers (unlike English) PHP is one among many thousands of such languages…

What's special about PHP? Web-based, familiar user interfaces, easy integration with other web-based systems Current, designed according to the latest understanding of programming language design. Portable, so it can be run on almost any computer. Object-oriented, like the most popular languages (Java, C++) used today for the most innovative applications. Convenient, loaded with powerful and useful features, supports many different programming styles Used, lots of PHP in use today (incl. the most "popular" dynamic web sites), more all the time, lots of non-trivial examples and free resources Not Proprietary, and that’s good!

PHP Usage Source:

How Does PHP Work? PHP is a program that performs dynamic HTML scripting –It is a language interpreter that directly executes commands then ultimately outputs into HTML/HTTP (rather than a compiler which outputs translates commands into machine code for later execution) –The server knows to execute PHP code when the requested file has a.php extension HTML + PHP code PHP Scripting Engine Static HTML output Dynamic data (files, database, webserver, data feeds, etc.) Web Server (e.g. Apache) Client (e.g. IE) Give me page xxx.php Must have.php extension!

PHP is Gateway to Shared Services and Data

Example Dynamic Web Page Open your favorite text editor and type <?php echo ' Hello World! '; echo '1+2='; echo 1+2; ?> Note that PHP code will always be enclosed inside the or tags. Outside is HTML (but notice that inside there can be HTML too) Questions –Why is this a "dynamic" web page? –Why wouldn't this file work the same if you called it index.html? –When you do a "view source" in the browser, where is the PHP code?

Tour of a PHP IDE: Simple Output Several parts to an IDE (for us, NetBeans for PHP) –Editor (for writing code) –File manager –Preview (web-server, web-browser) –Tools (documentation, debugger, scripts, etc.) In the IDE, let’s type and run the following: Hello World! 1+2= <?php // add 1 and 2 then print out the result echo 1+2; ?> Why is this the same as the previous dynamic web page example?

Server Side PHP Page with current date The date is: <?php echo date(DATE_RFC2822); ?> -Who’s date is used? -What if the server were in a different time zone? Page redirection <?php header('Location: ?> -In JavaScript window.location = ' -HTML Note how this HTML is just “passed” though the PHP scripting engine What’s the difference?

Client vs. Server Side Processing What’s the difference? Client SideServer Side Can directly manipulate page objectsCan manipulate web server behavior e.g. page processing No network communication neededSecures data and actions away from users Local user data from client onlyUser data can be shared for any client Can “guard” data for validation before submission for quick recovery Process data from clients Can access shared data and services (files, databases, other servers, processes, etc.)

Libraries and Frameworks Both PHP and JavaScript have many useful frameworks and libraries to help you do just about anything! PHP: php.net/manual/en/extensions.alphabetical.php pear.php.net/packages.php, JavaScript: DOM, JQuery, Angular, AJAX, COMET, DataTables, etc.

Client + Server Side Processing Compare dates Server Time: <?php echo date(DATE_RFC2822); ?> Browser Time: document.write( Date().toString() ); Generating JavaScript with PHP Make a page that generates a random color <?php echo "document.body.style.backgroundColor= 'rgb(". rand(0,255). ','. rand(0,255). ','. rand(0,255). ")';" ?>