CP476 Internet Computing-week-1-1.pdf
Document Details
Uploaded by ZippyPelican
Wilfrid Laurier University
Tags
Full Transcript
CP476 Internet Computing Week 1 – 1 Introduction Shaun Gao, Ph.D., P.Eng. Agenda Course introduction and notifications What is Internet computing? HTTP How web server works Web Server side languages Introduction to PHP PHP basics PHP Case Sensitivity Comments in PHP Some useful resources Summary CP4...
CP476 Internet Computing Week 1 – 1 Introduction Shaun Gao, Ph.D., P.Eng. Agenda Course introduction and notifications What is Internet computing? HTTP How web server works Web Server side languages Introduction to PHP PHP basics PHP Case Sensitivity Comments in PHP Some useful resources Summary CP476A Course information Instructor: Lunshan (Shaun) Gao, PhD, P.Eng. Email: [email protected] Reference textbooks PHP for the Web, 5th edition by Larry Ullman, Publisher Peachpit Press 2016 Learning PHP, MySQL & JavaScript: A Step-by-Step Guide to Creating Dynamic Websites by Robin Nixon, Publisher O'Reilly 2021 Course format: Lectures: Mondays and Wednesdays Practices & Tutorials: Fridays (bring your own PC in classroom) Evaluation scheme Group project presentation Group project report Test 2x15% Final 15% 15% 30% 40% Course information – cont. Week1 – introduction Week2,3,4 – PHP and Apache Week5 –-PHP OOP-- (test 1) Week6 – PHP data object Week7,8 – JavaScript Week9 –-JavaScript event process-- (test 2) Week10 – Node.js introduction Week11 – group project presentation Week12 – group project presentation, project report due Prerequisite knowledge: HTML, HTTP protocol, C Database (MySQL) Academic Integrity Anything you submit for credit is expected to be your own work Course information – cont. Group project 3-4 students become a team for the project (1).Front end, (2).web server, (3). back end, (4).DB Send me an email to tell me your team members by the end of January. The project requirements in myls How your project will be evaluated 6 minute presentation (3 minutes theory, 3 minutes demo) Presentation evaluation rubrics, please refer to the rubrics in MyLS Project report – Software system design documentation or technical report Internet Computing What is computing? Use of a computer to process data or perform calculations Definition: Internet computing is an architecture that supports all information flows and processes over the Internet, it provides access to all applications. With Internet computing, all a user needs is a standard Web browser and security clearance. Examples of Internet computing https://onecompiler.com/php/3xq663r2h https://www.online-python.com/ https://onecompiler.com/javascript HTTP protocol HTTP (Hypertext Transfer Protocol) to communicate between web client and web server. HTTP is an application-layer protocol Request / Response Cycle You enter http://server.com into your browser’s address bar. Your browser looks up the IP address for server.com – DNS. Your browser issues a request to server.com using the IP address. The request crosses the Internet and arrives at the server.com web server. The web server, having received the request and analyze it. The web page is retrieved by the server and returned to the browser. Your browser displays the web page. HTTP request/response – without DB Request Response HTTP request/response – with DB. Request Response Apache web server Apache http server project http://httpd.apache.org Apache foundation started to support the web server project, but now extends to a multitude of other projects. Apache: the second place from market share perspective. Start Apache From the opened DOS command window, type the following from “{Your directory path}/Apache24/bin”. > httpd -k install Check that you can access http://localhost in your browser Configuration folder and file names conf: configuration files, httpd.conf htdocs: contains web pages you can change it in configuration file Web Server side languages PHP is not the only language for server side programming. JavaScript (Node.js), Python, Java etc. PHP is the most used one based on https://w3techs.com/ Introduction to PHP Before you continue, you should have a basic understanding of the following: HTML CSS - optional JavaScript – we will learn it from week 7 If you want to study these subjects first, find the tutorials on https://www.w3schools.com/default.asp Introduction to PHP – cont. What is PHP? PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open-source scripting language PHP scripts are executed on the server PHP is free to download and use PHP is an amazing and popular language! PHP is a scrip language, and it can be run without compiling Introduction to PHP – cont. What is a PHP File? PHP files can contain text, HTML, CSS, JavaScript, and PHP code PHP code is executed on the server, and the result is returned to the browser as plain HTML PHP files have extension ".php" Example: Introduction to PHP – cont. What Can PHP Do? PHP can generate dynamic page content PHP can create, open, read, write, delete, and close files on the server PHP can collect data from Database (SQL, noSQL statements) PHP can send and receive cookies PHP can add, delete, modify data in database PHP can be used to control user-access PHP can encrypt data 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. Introduction to PHP – cont. Why PHP? PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.) PHP is compatible with almost all servers used today (Apache, IIS, etc.) PHP supports a wide range of databases PHP is free. Download it from the official PHP resource: www.php.net PHP is easy to learn and runs efficiently on the server side PHP basics PHP code is enclosed between Syntax: File name must have the extension.php, e.g. hello_world.php A PHP script consists of one or more statements and comments, there is no need for a main function (or classes) PHP basics –cont. PHP Case Sensitivity keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are not case-sensitive. For example - demo However, all variable names are case-sensitive! (PHP variable starts with $) $COLOR differs from $coLOR PHP basics –cont. Comments in PHP A comment in PHP code is a line that is not executed as a part of the program. Its only purpose is to help readers to understand the code. Syntax for single-line comments: Syntax for multiple-line comments: Summary HTTP How web server works Web Server side languages Introduction to PHP PHP basics PHP Case Sensitivity Comments in PHP Useful resources https://www.w3schools.com/php/default.asp https://sandbox.onlinephpfunctions.com/ Announcement Project is a group work. Three or Four of you become a group. Please send me an email by the end of January 2024.