PHP INCLUDES FOR MODULARIZATION CIT 230 – WEB FRONT-END DEVELOPMENT.

Slides:



Advertisements
Similar presentations
Intro to HTML Basics HTML = Hypertext Mark-up Language HTML = Hypertext Mark-up Language HTML is a plain-text file that can be created using a text editor.
Advertisements

Server-Side Includes (SSI) an Introduction and Demonstration presented by: Sean Conklin CMS Project Student-Assistant MWF mornings WA 406, x4200
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Lecture 2B: HTML and CSS IT 202—Internet Applications Based on notes developed by Morgan Benton.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Chapter 14 Introduction to HTML
Tags through Forms. This element is required for all HTML pages It must be at the top of every page of every website We’ll see later on why it is important.
Tutorial 1: Getting Started with HTML5
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.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
CIT 256 Organizing Large Websites: Divs, DW Templates Dr. Beryl Hoffman.
Advanced Web 2012 Lecture 4 Sean Costain PHP Sean Costain 2012 What is PHP? PHP is a widely-used general-purpose scripting language that is especially.
PHP. Why should we learn web programming? No need write socket programming. - You can forget TCP/IP & OSI layers. - Web server handles socket tasks for.
Week 1.  Phillip Chee   Ext.1214 
CS117 Introduction to Computer Science II Lecture 2 Creating an HTML Document Instructor: Li Ma Office: NBC 126 Phone: (713)
Links in HTML. Hyperlinks or links Millions of linked web pages make up the World Wide Web Used to connect a web page to another web page on the same.
Basic HTML Hyper text markup Language. Re-cap  … - The tag tells the browser that this is an HTML document The html element is the outermost element.
Build a Free Website1 Build A Website For Free 2 ND Edition By Mark Bell.
Views Carol Wolf Computer Science. Extended Ruby  Views files are written in extended Ruby, erb.  They end in.html.erb.  Ruby code is intermixed with.
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file names. File names ARE.
Processing.js.
HTML INTRODUCTION. What is HTML?  HTML stands for Hypertext Markup Language  Developed in 1990  Hidden code that helps us communicate with others on.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
IS1825: Developing Multimedia Applications for Business Lecture 1: Introduction to CSS Rob Gleasure
INTRODUCTION TO HTML5 Semantic Layout in HTML5.  The new semantic layout in HTML5 refers to a new class of elements that is designed to help you understand.
09/29/ Cascade Server User's Conference 1 Cascade Server Flash & Data Integration 2009 Cascade Server User’s Conference Justin Klingman Manager,
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
Computational Boot Camp HTML Mike Schaffer. 8/23/2002 (MES) HTML What is HTML? HTML stands for HyperText Markup Language HTML is the language for publishing.
Web Foundations MONDAY, NOVEMBER 18, 2013 LECTURE 30: DREAMWEAVER: GETTING STARTED, INTERFACE, TAG SELECTORS, LOCAL SITE, REMOTE SITE, SYNCHRONIZATION.
INTRODUCTION TO CSS. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features of CSS Features of CSS  Creating Style Sheet Creating Style Sheet.
Images Worksheet. Web template Download the template folder Unzip and save in your documents Rename the folder to “images work” without quotes.
Lecture Note 8: ASP Including Files and The Global.asa file.
HTML. Hyper Text Markup Language Markup your text document The markup is the tag Hyper text means you can jump from place to place.
Quick Questions 1. What does HTML stand for? 2. What are the three main languages of the Web? 3. What is the purpose of the tags? 4. Why do we indent different.
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
PHP “Personal Home Page Hypertext Pre-processor” (a recursive acronym) Allows you to create dynamic web pages and link web pages to a database.
Lecture Capture and. Goal Link to D2L D2L Website
 Look especially at › File Tips and Shortcuts › Student video.
Session 2: Basic HTML HTML Coding Spring 2009 The LIS Web Team Presents.
Chap 2 – Getting Started COMP YL Professor Mattos.
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
CSU Extension Webpage Template Session 4 February 2010.
Practice for Chapter 3: Assume that you are a freelance web designer and need to create a website to promote your freelance company.
Arrays and Loops. Learning Objectives By the end of this lecture, you should be able to: – Understand what a loop is – Appreciate the need for loops and.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
How to build a Web Page or “The things geeks never told you!”
HTML. Hyper Text Markup Language Markup your text document The markup is the tag Hyper text means you can jump from place to place Programming language.
WEB DESIGN CONCEPTS Brayden Burr. UNDERSTANDING THE CONTENT.
 A Javascript library designed to simplify client-side scripting of HTML.
HTML Structure & syntax
Working with HTML5 & DIV Structures, CSS, Webfonts and Templates
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
>> PHP: HTML Integration
The Difference Between STATIC & DYNAMIC Websites
BASIC PHP and MYSQL Edward S. Flores.
HTML Vocabulary.
How files are organized
Title: Tech Training Certificate: Ace of Initiative Program
Building Web Applications
Nerd Website HTML.
CSS.
Tutorial 10: Programming with javascript
The language of the internet
The language of the internet
HTML Structure & syntax
Presentation transcript:

PHP INCLUDES FOR MODULARIZATION CIT 230 – WEB FRONT-END DEVELOPMENT

WHAT IS MODULARIZATION? Modularization is the idea of separating a website into modules. A module can be a section that repeats itself across a website. Example: Website headers and website footers can be modules. They are usually the same throughout an entire website. Website Body Header Footer

WHY USE MODULARIZATION? Imagine a 250-page website that needs an update in the footer. With html only, you’d have to edit every single page, which would be a very tedious and error-prone task (even with copy/paste). It saves time, money, and is easy to maintain. It can be done with a PHP include.

WHAT IS A PHP INCLUDE? PHP is a scripting language used for web development. include is a command in the PHP language. It tells PHP to “include” a file. This is how a website can be modularized.

SYNTAX OF PHP INCLUDE STATEMENT The syntax is composed of 5 elements 1. The opening PHP tag: <?php 2. The include command itself: include 3. The file path and name in quotes: ’/modules/footer.php’ 4. A semi-colon to end the PHP statement: ; 5. The closing PHP tag: ?> The result:

WHERE TO INCLUDE THIS PHP INCLUDE? The include statement can go right in the html code. This is part of the file path. It tells the server to start at the root. Without this segment, the path would look something like this instead:

FILE STRUCTURE With PHP include, you only need 1 file per module. A suggestion is to keep them organized into a module folder. Example: footer.php can be designated to be the only footer file across the entire website.

WHAT IS INSIDE THE MODULE FILE? The actual code that will be inserted! It is not an html file, so,, etc. are not needed. Think of it as a snippet of code that is going to be inserted into a real html file (the one with the php include).

EXAMPLE: BEFORE PHP INCLUDE

EXAMPLE: AFTER PHP INCLUDE

WHAT ABOUT THE PAGE SOURCE? Assuming the web host supports PHP, visitors will not see the php code in the page source. PHP leaves no evidence!

RESOURCES From PHP itself: YouTube video on using PHP includes to modularize a website: THANK YOU