SlideShare a Scribd company logo
Web Design
and
Development
By: Shahrzad Peyman
Session 8
December-2017
shahrzad.peymaan@gmail.com
1
2
Today’s Presentation
• Class
• Object
• $this
• Form Handling
Object Oriented Programming
3
A What is Object-Oriented Programming (OOP)?
Object-oriented programming (OOP) is a programming
paradigm based on the concept of "objects".
So,
Objects are key to understanding object-oriented
technology.
What is Object?
4
❖Many examples of real-world objects
▪ your Book, your PC, your Mobile, your Computer mouse
and so on.
❖Real-world objects share two characteristics:
▪ State
▪ Behavior
❖Software Objects
▪ Modeled after real-world objects.
▪ Maintains its states in variables or attributes.
▪ Implements its behaviors with methods.
Objects
5
▪ E.g. A Computer Mouse is a real-world Object. Its states
would be its color, size and brand name and its behaviors
would be left-click, right-click and middle click.
▪ Software object that modeled your real-world computer
mouse.
▪ Have variables(attributes) that indicated the computer
mouse’s current states:
▪ Its color is black.
▪ Its size is medium.
▪ Its brand name is Genius.
▪ Have methods that indicated the computer mouse’s
current behaviors like left-click, right-click and middle click.
What is Class?
6
▪ A class is a prototype that defines the variables and
the methods common to all objects of a certain kind.
▪ A class is an entity that helps the programmer to
define a new complex data type.
➢An object is an instance of a class.
➢A class defines the data and behavior of objects.
➢E.g. Apple, Orange and banana are members of
the fruit class.
Class in PHP
7
▪Basic class definitions begin with the keyword
class, followed by a class name.
▪Then, followed by a pair of curly braces which
enclose the definitions of the properties and
methods belonging to the class.
Object in PHP
8
▪Instance of Class
Objects and Class Sample
9
Define First Class and Object
10
$this
11
$this is mainly used to refer
properties of a class.
It is the way to reference an
instance of a class from within
itself, the same as many other
object oriented languages.
From the  PHP  docs: The
pseudo-variable $this is
available when a method is
called from within an object
context.
Form Handling
12
The main way that website users interact with PHP is
through the use of HTML forms.
Handling forms is a multipart process. First a form is
created, into which a user can enter the required details.
This data is then sent to the web server, where it is
interpreted, often with some error checking. If the PHP
code identifies one or more fields that require
reentering, the form may be redisplayed with an error
message. When the code is satisfied with the accuracy
of the input, it takes some action that usually involves
the database, such as entering details about a purchase.
Form Handling
13
To build a form, you must have at least the
following elements:
1- An opening <form> and closing </form> tags.
2- A submission type specifying either a Get or
Post method.
3- One or more input fields.
4- The destination URL to which the form data is
to be submitted.
Form Handling
14
Retrieving Submitted Data
15
Only one part of the multipart form-handling
process. If you enter a name and click the Submit
Query button, absolutely nothing will happen
other than the form being redisplayed. So now it’s
time to add some PHP code to process the data
submitted by the form.
Retrieving Submitted Data
16

More Related Content

PDF
Web Design & Development - Session 7
PDF
Object Oriented Programming with Laravel - Session 1
PPT
Tech talk webtech
PPT
Tech talk php_cms
PPTX
Document Object Model
PPTX
Dhtml
PPTX
Document object model(dom)
PPTX
Web Design & Development - Session 7
Object Oriented Programming with Laravel - Session 1
Tech talk webtech
Tech talk php_cms
Document Object Model
Dhtml
Document object model(dom)

What's hot (20)

PPT
KMUTNB - Internet Programming 1/7
PDF
Web Design & Development Courses in Pune| 3DOT Technologies
PDF
Html Tutor
PPT
4 internet programming
PPT
Document Object Model
PPTX
Web Design & Development Courses in Pune |Web Development Classes in Pune | ...
PPTX
PPTX
PHP Presentation
PPTX
PPTX
Front-end development introduction (HTML, CSS). Part 1
PPTX
05 RD PoSD Tutorial_xhtml_to_html5_2016
PPTX
INFT132 093 07 Document Object Model
PDF
Bridging the gap between business and technology - Behaviour Driven Developme...
PPTX
0 csc 3311 slide internet programming
PPTX
Html 5 tutorial - By Bally Chohan
PPTX
The Difference between HTML, XHTML & HTML5 for Beginners
PPT
PHP Project PPT
PPTX
1 introductin to HTML
KMUTNB - Internet Programming 1/7
Web Design & Development Courses in Pune| 3DOT Technologies
Html Tutor
4 internet programming
Document Object Model
Web Design & Development Courses in Pune |Web Development Classes in Pune | ...
PHP Presentation
Front-end development introduction (HTML, CSS). Part 1
05 RD PoSD Tutorial_xhtml_to_html5_2016
INFT132 093 07 Document Object Model
Bridging the gap between business and technology - Behaviour Driven Developme...
0 csc 3311 slide internet programming
Html 5 tutorial - By Bally Chohan
The Difference between HTML, XHTML & HTML5 for Beginners
PHP Project PPT
1 introductin to HTML
Ad

Similar to Web Design & Development - Session 8 (20)

PPT
PHP- Introduction to Object Oriented PHP
PPTX
Php oop (1)
PPTX
Lecture-10_PHP-OOP.pptx
PDF
A Gentle Introduction To Object Oriented Php
PPTX
Oop in-php
PDF
Oop in php_tutorial
PDF
Object_oriented_programming_OOP_with_PHP.pdf
PDF
09 Object Oriented Programming in PHP #burningkeyboards
PDF
Oop in php tutorial
PDF
oop_in_php_tutorial_for_killerphp.com
PDF
oop_in_php_tutorial_for_killerphp.com
PDF
Oop in php_tutorial_for_killerphp.com
PDF
Object Oriented PHP - PART-1
PPTX
12-OO-PHP.pptx
PPT
Synapseindia object oriented programming in php
PDF
OOP in PHP
DOCX
Oops concept in php
PPTX
Lecture9_OOPHP_SPring2023.pptx
PPTX
Introduction to PHP and MySql basics.pptx
PDF
tutorial54
PHP- Introduction to Object Oriented PHP
Php oop (1)
Lecture-10_PHP-OOP.pptx
A Gentle Introduction To Object Oriented Php
Oop in-php
Oop in php_tutorial
Object_oriented_programming_OOP_with_PHP.pdf
09 Object Oriented Programming in PHP #burningkeyboards
Oop in php tutorial
oop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.com
Oop in php_tutorial_for_killerphp.com
Object Oriented PHP - PART-1
12-OO-PHP.pptx
Synapseindia object oriented programming in php
OOP in PHP
Oops concept in php
Lecture9_OOPHP_SPring2023.pptx
Introduction to PHP and MySql basics.pptx
tutorial54
Ad

More from Shahrzad Peyman (11)

PDF
Web Design & Development - Session 9
PDF
Web Design & Development - Session 6
PDF
Web Design & Development - Session 4
PDF
Web Design & Development - Session 3
PDF
Web Design & Development - Session 2
PDF
Web Design & Development - Session 1
PDF
Object Oriented Programming with Laravel - Session 6
PDF
Object Oriented Programming with Laravel - Session 5
PDF
Object Oriented Programming with Laravel - Session 4
PDF
Object Oriented Programming with Laravel - Session 3
PDF
Object Oriented Programming with Laravel - Session 2
Web Design & Development - Session 9
Web Design & Development - Session 6
Web Design & Development - Session 4
Web Design & Development - Session 3
Web Design & Development - Session 2
Web Design & Development - Session 1
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 2

Recently uploaded (20)

PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
System and Network Administraation Chapter 3
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
top salesforce developer skills in 2025.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Odoo Companies in India – Driving Business Transformation.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
System and Network Administraation Chapter 3
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PTS Company Brochure 2025 (1).pdf.......
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
VVF-Customer-Presentation2025-Ver1.9.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
top salesforce developer skills in 2025.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Odoo POS Development Services by CandidRoot Solutions
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Odoo Companies in India – Driving Business Transformation.pdf

Web Design & Development - Session 8

  • 1. Web Design and Development By: Shahrzad Peyman Session 8 December-2017 shahrzad.peymaan@gmail.com 1
  • 2. 2 Today’s Presentation • Class • Object • $this • Form Handling
  • 3. Object Oriented Programming 3 A What is Object-Oriented Programming (OOP)? Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects". So, Objects are key to understanding object-oriented technology.
  • 4. What is Object? 4 ❖Many examples of real-world objects ▪ your Book, your PC, your Mobile, your Computer mouse and so on. ❖Real-world objects share two characteristics: ▪ State ▪ Behavior ❖Software Objects ▪ Modeled after real-world objects. ▪ Maintains its states in variables or attributes. ▪ Implements its behaviors with methods.
  • 5. Objects 5 ▪ E.g. A Computer Mouse is a real-world Object. Its states would be its color, size and brand name and its behaviors would be left-click, right-click and middle click. ▪ Software object that modeled your real-world computer mouse. ▪ Have variables(attributes) that indicated the computer mouse’s current states: ▪ Its color is black. ▪ Its size is medium. ▪ Its brand name is Genius. ▪ Have methods that indicated the computer mouse’s current behaviors like left-click, right-click and middle click.
  • 6. What is Class? 6 ▪ A class is a prototype that defines the variables and the methods common to all objects of a certain kind. ▪ A class is an entity that helps the programmer to define a new complex data type. ➢An object is an instance of a class. ➢A class defines the data and behavior of objects. ➢E.g. Apple, Orange and banana are members of the fruit class.
  • 7. Class in PHP 7 ▪Basic class definitions begin with the keyword class, followed by a class name. ▪Then, followed by a pair of curly braces which enclose the definitions of the properties and methods belonging to the class.
  • 9. Objects and Class Sample 9
  • 10. Define First Class and Object 10
  • 11. $this 11 $this is mainly used to refer properties of a class. It is the way to reference an instance of a class from within itself, the same as many other object oriented languages. From the  PHP  docs: The pseudo-variable $this is available when a method is called from within an object context.
  • 12. Form Handling 12 The main way that website users interact with PHP is through the use of HTML forms. Handling forms is a multipart process. First a form is created, into which a user can enter the required details. This data is then sent to the web server, where it is interpreted, often with some error checking. If the PHP code identifies one or more fields that require reentering, the form may be redisplayed with an error message. When the code is satisfied with the accuracy of the input, it takes some action that usually involves the database, such as entering details about a purchase.
  • 13. Form Handling 13 To build a form, you must have at least the following elements: 1- An opening <form> and closing </form> tags. 2- A submission type specifying either a Get or Post method. 3- One or more input fields. 4- The destination URL to which the form data is to be submitted.
  • 15. Retrieving Submitted Data 15 Only one part of the multipart form-handling process. If you enter a name and click the Submit Query button, absolutely nothing will happen other than the form being redisplayed. So now it’s time to add some PHP code to process the data submitted by the form.