What-is-HTML
What-is-HTML
HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link",
etc.
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Explaination
• The <!DOCTYPE html> declaration defines that this document is an HTML5 document
• The <html> element is the root element of an HTML page
• The <head> element contains meta information about the HTML page
• The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in
the page's tab)
• The <body> element defines the document's body, and is a container for all the visible contents, such as
headings, paragraphs, images, hyperlinks, tables, lists, etc.
• The <h1> element defines a large heading
• The <p> element defines a paragraph
An HTML element is defined by a start tag, some content, and an end tag:
<tagname> Content goes here... </tagname>
The HTML element is everything from the start tag to the end tag:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
Start Tag Element content End Tag
<h1> My First Heading </h1>
<p> My first paragraph. </p>
<br> none none
Note: Some HTML elements have no content (like the <br> element). These elements are called empty
elements. Empty elements do not have an end tag!
Web Browsers
The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them
correctly.
A browser does not display the HTML tags, but uses them to determine how to display the document:
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
Note: The content inside the <body> section will be displayed in a browser. The content inside the <title>
element will be shown in the browser's title bar or in the page's tab.
Tag Description
<col> Specifies column properties for each column within a <colgroup> element
Example
table, th, td {
border: 1px solid black;
}
Collapsed Table Borders
To avoid having double borders like in the example above, set the CSS border-collapse property to collapse.
This will make the borders collapse into a single border:
Example
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
With the border-style property, you can set the appearance of the border.
• dotted
• dashed
• solid
• double
• groove
• ridge
• inset
• outset
• none
• hidden
HTML Form
An HTML form is used to collect user input. The user input is most often sent to a server for processing.
The <form> Element
The HTML <form> element is used to create an HTML form for user input:
<form>
.
form elements
.
</form>
The <form> element is a container for different types of input elements, such as: text fields, checkboxes, radio
buttons, submit buttons, etc.
All the different form elements are covered in this chapter: HTML Form Elements.
<input type="email">
<input type="file">
<input type="hidden">
<input type="image">
<input type="month">
<input type="number">
<input type="password">
<input type="radio">
<input type="range">
<input type="reset">
<input type="search">
<input type="submit">
<input type="tel">
Input Type Text
<input type="reset"> defines a reset button that will reset all form values to their default values.
Input Type Button
The <input type="color"> is used for input fields that should contain a color.
Depending on browser support, a color picker can show up in the input field.
Input Type Date
The <input type="date"> is used for input fields that should contain a date.
Depending on browser support, a date picker can show up in the input field.
You can also use the min and max attributes to add restrictions to dates
Input Type Email
The <input type="email"> is used for input fields that should contain an e-mail address.
What is CSS?
CSS stands for Cascading Style Sheets
CSS describes how HTML elements are to be displayed on screen, paper, or in other media
CSS saves a lot of work. It can control the layout of multiple web pages all at once
CSS is used to define styles for your web pages, including the design, layout and variations in display for
different devices and screen sizes.
CSS Syntax
Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly
braces.
Example
In this example, all <p> elements will be center-aligned, with a red text color:
p {color: red; text-align: center;}
Example Explained
p is a selector in CSS (it points to the HTML element you want to style: <p>).
What is PHP?
PHP is an acronym for "PHP: Hypertext Preprocessor"
PHP code is executed on the server, and the result is returned to the browser as plain HTML
PHP files have extension “.php”
PHP Variables
A variable can have a short name (like $x and $y) or a more descriptive name ($age, $carname, $total_volume).
Rules for PHP variables:
A variable starts with the $ sign, followed by the name of the variable
A variable name must start with a letter or the underscore character
Variables can store data of different types, and different data types can do different things.
PHP supports the following data types:
• String
• Integer
• Float (floating point numbers - also called double)
• Boolean
• Array
• Object
• NULL
• Resource
PHP String
A string is a sequence of characters, like "Hello world!".
A string can be any text inside quotes. You can use single or double quotes:
PHP Integer
An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647.
A float (floating point number) is a number with a decimal point or a number in exponential form.
PHP Boolean
A Boolean represents two possible states: TRUE or FALSE.
PHP Array
An array stores multiple values in one single variable.
What is an Array?
An array is a special variable that can hold many values under a single name, and you can access the values by
referring to an index number or name.
PHP Object
Classes and objects are the two main aspects of object-oriented programming.
A class is a template for objects, and an object is an instance of a class.
When the individual objects are created, they inherit all the properties and behaviors from the class, but each
object will have different values for the properties.
PHP NULL Value
Null is a special data type which can have only one value: NULL.
A variable of data type NULL is a variable that has no value assigned to it.
Tip: If a variable is created without a value, it is automatically assigned a value of NULL.
What is SQL?
SQL is the standard query language for dealing with Relational Databases.
The WHERE clause can be combined with AND, OR, and NOT operators.
The AND and OR operators are used to filter records based on more than one condition:
The AND operator displays a record if all the conditions separated by AND are TRUE.
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
What is a NULL Value?
UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition;
Note: Be careful when updating records in a table! Notice the WHERE clause in the UPDATE statement. The
WHERE clause specifies which record(s) that should be updated. If you omit the WHERE clause, all records in
the table will be updated!
The MySQL DELETE Statement
Stack traces contain information about all of the functions that are running at a given moment. The stack trace
provided by this method has information about the stack at the time that the exception was thrown.
Syntax
$exception->getTrace()
Technical Details