A290 TOOLS IN COMPUTING: PHP

Slides:



Advertisements
Similar presentations
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Advertisements

Understand Web Page Development Software Development Fundamentals LESSON 4.1.
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
CIS101 Introduction to Computing Week 05. Agenda Your questions Exam next week - Excel Introduction to the Internet & HTML Online HTML Resources Using.
Master’s course Bioinformatics Data Analysis and Tools Lecture 6: Internet Basics Centre for Integrative Bioinformatics.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Tutorial 1: Introduction to JavaScript JavaScript - Introductory.
CIS101 Introduction to Computing Week 06. Agenda Your questions Excel Exam during second hour Our status after the snow day Introduction to the Internet.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
Web Page A page displayed by the browser. Website Collection of multiple web pages Web Browser: A software that displays web pages on client computer.
PHP: Hypertext Processor Fred Durao
INTRODUCTION TO WEB DATABASE PROGRAMMING
Computer Concepts 2014 Chapter 7 The Web and .
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
Chapter 16 The World Wide Web Chapter Goals ( ) Compare and contrast the Internet and the World Wide Web Describe general Web processing.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
INTERNET APPLICATION DEVELOPMENT For More visit:
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
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.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Web Engineering we define Web Engineering as follows: 1) Web Engineering is the application of systematic and proven approaches (concepts, methods, techniques,
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
JavaScript Tutorial 1 - Introduction to JavaScript1 Tutorial 1 Introduction to JavaScript Section A – Programming, HTML, and JavaScript.
Introduction to JavaScript CS101 Introduction to Computing.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
PHP Form Processing * referenced from
Matthew Baillie, Luke Day THE INTERNET. HISTORY OF THE INTERNET J.C.R. Licklider authored a series of memos concerning theoretical network structures.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
1 UNIT 13 The World Wide Web. Introduction 2 The World Wide Web: ▫ Commonly referred to as WWW or the Web. ▫ Is a service on the Internet. It consists.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
Web Programming Language
4.01 How Web Pages Work.
WWW and HTTP King Fahd University of Petroleum & Minerals
CSC201: Computer Programming
JavaScript and Ajax (Internet Background)
Warm Handshake with Websites, Servers and Web Servers:
Chapter 2 Client/Server Applications
E-commerce | WWW World Wide Web - Concepts
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
E-commerce | WWW World Wide Web - Concepts
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Developing Web-Based Applications
PHP / MySQL Introduction
PHP Introduction.
A290 TOOLS IN COMPUTING: JAVASCRIPT
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 27 WWW and HTTP.
WEB PROGRAMMING JavaScript.
Module 1 Introduction to PHP 11/30/2018 CS346 PHP.
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Web Page Concept and Design :
Introduction to computers
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Chapter 16 The World Wide Web.
Intro to PHP.
4.01 How Web Pages Work.
Web Application Development Using PHP
Presentation transcript:

A290 TOOLS IN COMPUTING: PHP FALL 2017 FIRST 8 WEEKS WELCOME

Introduction Instructor: Olgun Sadik Email: olsadik@indiana.edu Office: Lindley 401D Office Hour: By appointment (via email)

Undergraduate Instructor Jiawei Zhang zhang435@umail.iu.edu Office Hours: Mondays 2:30-3:30 Lindley Hall 2nd floor lobby (where the students sleep and study) Individual appointment available via email

Course Pre-survey Please fill out the course pre-survey from the class website.

Course Canvas Site The class website and Canvas are our main resources: Syllabus (the class website) Access to Course Materials (Books 24/7 and the class website) Main Textbook Beginning PHP 5.3 by Matt Doyle Course Schedule (the class website) Assignments/Feedback (Canvas) Announcements (Canvas) Grades (Canvas) In class activities: Pair Programming

PHP Personal Home Page PHP Hypertext Preprocessor Created in 1994 by Rasmus Lerdorf, originally used for tracking visits to his online resume, he named the suite of scripts "Personal Home Page Tools," more frequently referenced as "PHP Tools." Over time, more functionality was desired, and Rasmus rewrote PHP Tools, producing a much larger and richer implementation. This new model was capable of database interaction and more, providing a framework upon which users could develop simple dynamic web applications such as guestbooks. In June of 1995, Rasmus » released the source code for PHP Tools to the public, which allowed developers to use it as they saw fit. This also permitted - and encouraged - users to provide fixes for bugs in the code, and to generally improve upon it. Source: http://php.net/manual/en/history.php.php

Hypertext “The World Wide Web (WWW) combines computer networking (the Internet) and Hypertext MarkUp Language (HTML) into an easy to use system by which people can access information around the world from a desktop computer.” Hypertext is not a product, it is a concept we use to define ”the medium used to transmit the information in a non-linear fashion via computer by  clicking on a "link"  using a mouse. Hypertext= Hyperlink Source: http://mason.gmu.edu/~montecin/hypertext_flowchart.gif Source: http://mason.gmu.edu/~montecin/hypertext.htm

Preprocessor A program that processes its input data to produce output that is used as input to another program Source: Hanly, J. R., Koffman, E. B., & Friedman, F. L. (1996). Problem Solving and Program Design in C. Addison-Wesley.

PHP PHP is a server‐side scripting language for building dynamic, interactive Web sites. PHP code within HTML web pages. A dynamic web page is a page whose contents can change automatically each time the page is viewed. Contrast this with a static Web page, such as a simple HTML file, which looks the same each time it's displayed (at least until the page is next edited). Meanwhile, an interactive Web site is a site that responds to input from its visitors. A Web forum is a good example — users can post new messages to the forum, which are then displayed on the site for all to see. Another simple example is a "contact us" form, where visitors interact with the page by filling out and sending a form, which is then emailed to the Webmaster. PHP is a server‐side scripting language, which means that PHP scripts, or programs, usually run on a Web server. (A good example of a client‐side scripting language is JavaScript, which commonly runs within a Web browser.). Furthermore, PHP is an interpreted language — a PHP script is processed by the PHP engine each time it's run.  

Web Server A host computer for a website(s) that is connected to the Internet. A web server program Ex: Apache, Internet Information Server (IIS) A web site is a collection of web pages which are digital files generally written using HyperText Markup Language (HTML). For a web site to be available to everyone in the world at all times, it need to be stored or “hosted” on a computer that is connected to the internet 24/7/365. Such a computer is known as a Web Server. A web server program is software that runs on the web site hosting Server computer. Its main purpose is serving web pages; which means it waits for requests from web browsers (also known as clients) and responds by sending the required data back. This client-server interaction is the hallmark of how the web works. There are many web server programs available – check list of web servers. The most famous and popular of them all is Apache developed by the Apache Foundation. Web servers – the computer or the program – have a vital role on the Internet. The Server machine hosts (stores) the web site on its hard disk while the server program helps deliver the web pages and their associated files like images, flash movies etc. to clients (browsers). The process of loading a web site/page in a web browser starts with the user either entering the URL in the address bar or clicking on a link. You should know that each web page has a unique address (or URL) on the internet; which means the same page cannot exist in two places. (If a copy does exist in another location, its address would be different from that of the original).   Once the appropriate action has been initiated by the user, the browser sends out a request for the web page. Behind the scenes, the domain name (A domain name is simply a human readable form of an I.P. address while a URL stands for Universal Resource Locator and indicates the location of a file on the Internet.) of the requested web page is resolved into an I.P. address (DNS: Domain Name System), which, in English, means, converted to an I.P. address – something that computers understand. The I.P. address points to the location of the web site host. The request is forwarded to Server computer and passed on to the server software. The server software now gets to work and hunts for the requested web page on the hard disk. On finding the file, it sends a response to the browser followed the actual web page file which then starts displaying the page. Source: Doyle, M. (2011). Beginning PHP 5.3. John Wiley & Sons.

Process PHP is a server‐side scripting language for building dynamic, interactive Web sites. A visitor requests a Web page by clicking a link, or typing the page's URL into the browser's address bar. The visitor might also send data to the Web server at the same time, either using a form embedded in a Web page   The Web server recognizes that the requested URL is a PHP script, and instructs the PHP engine to process and run the script. The script runs, and when it's finished it usually sends an HTML page to the Web browser, which the visitor then sees on their screen. The interesting stuff happens when a PHP script runs. Because PHP is so flexible, a PHP script can carry out any number of interesting tasks, such as: Reading and processing the contents of a Web form sent by the visitor Reading, writing, and creating files on the Web server Working with data in a database stored on the Web server Grabbing and processing data from other Web sites and feeds Generating dynamic graphics, such as charts and manipulated photos And finally, once it's finished processing, it can send a customized HTML Web page back to the visitor. Source: Doyle, M. (2011). Beginning PHP 5.3. John Wiley & Sons.

HTML/PHP within each other <html> <head> <title> PHP introduction </title> </head> <body> <?php echo “Go Hoosiers”; ?> </body> </html> <html> <head> <title> PHP introduction </title> </head> <body> <?php echo “Go <br>”; echo “Hoosiers”; ?> </body> </html>

Creating your first script Go to the following website: http://phptester.net

Task 1 Search online to learn how to print your name in the result box. <?php   echo “Olgun Sadik”; ?>

Answer <?php echo “Olgun Sadik”; ?> The first line tells the PHP engine to expect some PHP code to follow: The next line displays your name PHP's echo() statement takes a string of text — in this case, "Olgun Sadik!" — and sends it as part of the Web page to the browser. The browser then displays the text to the visitor. Notice the semicolon (;) at the end of the line; this tells PHP that you've reached the end of the current statement, and it should look for a new statement (or the end of the PHP code) to follow. The final line of your simple script tells the PHP engine that it's reached the end of the current section of PHP code

Task 2 Display your name with the current time For example:   For example: Hello, Olgun. The current time is: 10:20:59 am

Answer <?php echo "Hello, Olgun. The current time is: ". date( "g:i:s a" ); ?> The date function takes the current time and formats it as a readable string of text. Date is a predefined function from PHP library. g, i, and s tell PHP to output the current hour, minute, and second, respectively. a tells PHP to display either "am" or ‘pm’ as appropriate. The colons (:) and the space character are not processed by the date() function, so they're displayed as is.

Comments To write a single-line comment, start the line with two slashes // This code displays the current time To write multi-line comments, start the comment with a slash followed by an asterisk (/*) and end the comment with an asterisk followed by a slash (*/): /* This code displays the current time in a nice, easy-to-read format. */

Most Common Errors in PHP Error = mistake Parse Error (Syntax Error): The parse error occurs if there is a syntax mistake in the script; the output is Parse error Unclosed quotes Missing or Extra parentheses Unclosed braces Missing semicolon

Most Common Errors in PHP Fatal Error:  Fatal errors are caused when PHP understands what you've written, however what you're asking it to do can't be done. Fatal errors stop the execution of the script. If you are trying to access the undefined functions, then the output is a fatal error.

Most Common Errors in PHP Warning Error: Warning errors will not stop execution of the script. The main reason for warning error is to include a missing file or using the incorrect number of parameters in a function. Notice Error: Notice error is the same as a warning error i.e. in the notice error, execution of the script does not stop. Notice that the error occurs when you try to access the undefined variable, then produce a notice error.

Taking care of errors= debugging Nice articles about debugging http://blog.teamtreehouse.com/how-to-debug-in-php https://www.ibm.com/developerworks/library/os-debug/

Before the next class Install Dreamweaver to your computer from iuware.indiana.edu. You are free to use any text editor that you feel comfortable. I will be using Dreamweaver. Install XAMPP on your laptop/computer. I will look at your pre-survey responses and will make some decisions regarding the syllabus.