Simple PHP An Introduction.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 1-1 The Web Wizards Guide to PHP by David A. Lash.
Advertisements

HTML.
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
1 Web Wizards Guide To PHP David Lash Chapter 1 Introduction to PHP.
HTMLMR.Mostafa badr1. Lesson 3 HTML Tags Lesson 2 Creating a HTML File Lesson 1: Hyper Text Markup Language (HTML) Basics Get Trained for a Better Future.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Understanding HTML Style Sheets. What is a style?  A style is a rule that defines the appearance and position of text and graphics. It may define the.
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”
Web page - A Web page is a simple text file that contains HTML tags (code) that describe what should be displayed on the browser. -The Web browser interprets.
Julien Thibault  HTML is the basic building-blocks of webpages  It is not a language!! (despite its name)  Structure text/media.
Creating a Basic Web Page
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Creating a Web page Using Basic HTML By: Magdalena Martinez CIEP 491 (W 6:00) Assessment #12.
18 People Surveyed HTML (HyperText Markup Language) HTML “tags” Describes structure Building blocks Headings, paragraphs, lists, links, images, quotes,
>> Introduction to HTML: Tags. Hyper - is the opposite of linear Text – words / sentences / paragraphs Mark-up – Marking the text Language – It is a language.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
HTML: Hyptertext Markup Language Doman’s Sections.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
Cascading Style Sheets Creating a Uniform Site. Style Sheets  Style sheets are used for conformity on a web page or web site.  Style sheets eliminate.
HTML & CSS BasicsHTMLCSSQuizAnswers  The logo In this website(made of html and css Codes), you will learn some basics of How to use HTML and CSS codes.
 A PHP script can be placed anywhere in the document.  A PHP script starts with  The default file extension for PHP files is ".php".  A PHP file normally.
External Style Sheets Exploring Computer Science – Lesson 3-6.
This shows CIS17 and the first day introduction..
Getting Started with HTML. HTML  Hyper Text Markup Language  HTML isn’t a program language, its known as a markup language  A Markup language has tags.
1 2/16/05CS120 The Information Era Chapter 4 Basic Web Page Construction TOPICS: Intro to HTML and Basic Web Page Design.
HTML HTML stands for Hyper Text Markup Language. HTML is used in making the base of a Website You can just use an online website maker like weebly.com.
HTML Basic Structure. Page Title My First Heading My first paragraph.
Basic HTML Page 1. First Open Windows Notepad to type your HTML code 2.
Week 1: Introduction to HTML and Web Design
Getting Started – Basic Page Structure
External Style Sheets.
non-native -> native?!
Module 1 Introduction to JavaScript
Web Basics: HTML/CSS/JavaScript What are they?
PHP variables.
Style Sheets.
4.01 Cascading Style Sheets
CHAPTER 5 SERVER SIDE SCRIPTING
>> CSS Rules Selection
Introduction to Web programming
PHP (PHP: Hypertext Preprocessor)
Intro to Web Development Class A Review
Principles of Software Development
CASCADING STYLE SHEET CSS.
Building a Webpage Extended Learning Module F
CSS.
Introduction to JavaScript
JavaScript an introduction.
Software Engineering for Internet Applications
Introduction to Web Page Design
Of HTML, CSS and JavaScript
Introduction to JavaScript
Module 1 Introduction to PHP 11/30/2018 CS346 PHP.
Cascading Style Sheets
HTML 12/27/2018.
Web Programming– UFCFB Lecture 11
Working with Cascading Style Sheets (CSS)
Working with Cascading Style Sheets (CSS)
Intro to Web Development HTML Structure
Intro to PHP.
Introduction to Web Application Design
HyperText Markup Language
4.01 Cascading Style Sheets
Introduction to JavaScript
INTERNATIONAL INSTITUTE OF IFORMATION TECHNOLOGY, (I²IT)
Web Programming and Design
One Set of Styles Connected to As Many Pages as You Want!!!
The Web Wizard’s Guide to PHP by David A. Lash
Presentation transcript:

Simple PHP An Introduction

Interpreting PHP Local Machine: Live Server Interpreter compiles code Run WAMP, LAMP, or MAMP in background & Access pages through it Live Server Most hosts provide PHP interpreter Interpreter compiles code Translates to displayable HTML Performs other operations

File Extension – Web Page .php Lets server know it needs to pass that code to interpreter If page would have been HTML, still have regular doctype definition and other HTML <!doctype html>

File Extension – Style SHeet .php 1st line in file must be: <?php header(“content-type: text/css”); ?> When link stylesheet to html, code is the same except for altered file extension Ex: <link href="stylephp.php" rel="stylesheet" type="text/css" />

Embedding PHP <?php ?> PHP can be Only code in file Embedded in portions along with other HTML Embedded in portions along with CSS <?php ?> Your Code Goes Here!

<body> <h2>This is the first PHP coding section</h2> <?php echo "This is <i>PHP code</i>\n"; ?> <h2>This is the second PHP coding section</h2> <?php echo "This is <b>more</b> PHP code\n"; ?> </body>

//nothing on this line will run or display ?> Comments <?php //nothing on this line will run or display ?> <?php /* This is a multiline comment. I can keep typing until I close the comment off */ ?>

Outputting Display Text & HTML Command: echo To have output display on page, php between body tags Can output numbers without surrounding characters Text must be surrounded with double or single quotes

<?php echo 15; //outputs the number 15 onto the web page echo "<br />"; //outputs a break onto the web page echo "this is a sentence"; //outputs text onto web page echo 'this is also a sentence'; //outputs text ?>

<head> </head> <?php echo “<title> My Webpage ?> </head>

Simple Math Operator Symbol Operation Performed + Addition - Subtraction * Multiplication / Division % Modulus (finds remainder of division problem)

<body> <?php echo "5+5="; //with quotes, displays literal text echo 5+5; //without quotes, performs calculation echo "<br />"; echo "10-5="; echo 10-5; ?> </body>

Example Full Page + PHP

Example Stylesheet + PHP