0% found this document useful (0 votes)
6 views8 pages

WEB (Notes)

learning notes

Uploaded by

jessica.bucton20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views8 pages

WEB (Notes)

learning notes

Uploaded by

jessica.bucton20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

What is HTML?

• The <h1> element defines a large heading


• The <p> element defines a paragraph What is an HTML Element?
HTML stands for Hyper Text Markup Language
An HTML element is defined by a start tag, some content, and an end tag:
HTML is the standard markup language for creating Web pages HTML <tagname> Content goes here... </tagname>
describes the structure of a Web page
HTML consists of a series of elements
The HTML element is everything from the start tag to the end tag:
HTML elements tell the browser how to display the content <h1>My First Heading</h1>
HTML elements label pieces of content such as "this is a heading", "this <p>My first paragraph.</p>
is a paragraph", "this is a link", Start Tag Element content End Tag
etc. <h1> My First Heading </h1>
<p> My first paragraph. </p>
<br> none none
A Simple HTML Document Example
<!DOCTYPE html>
Note: Some HTML elements have no content (like the <br> element).
<html>
These elements are called empty elements. Empty elements do not have
<head>
an end tag!
<title>Page Title</title>
</head>
<body> Web Browsers
The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read
HTML documents and display them correctly.
<h1>My First Heading</h1>
<p>My first paragraph.</p>
A browser does not display the HTML tags, but uses them to determine how to
display the document:
</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.
<tr> Defines a row in a table

<td> Defines a cell in a table

<caption> Defines a table caption

<colgroup> Specifies a group of one or more columns in a table for


formatting

<col> Specifies column properties for each column within a


<colgroup> element

<thead> Groups the header content in a table

<tbody> Groups the body content in a table

<tfoot> Groups the footer content in a table


HTML Page Structure

HTML tables can have borders of different styles and shapes. How To Add a
Below is a visualization of an HTML page structure: Border
To add a border, use the CSS border property on table, th, and td elements:

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

<p>This is another paragraph.</p>

Example

table, th, td {border: 1px solid black;}


Note: The content inside the <body> section will be displayed in a Collapsed Table Borders
browser. The content inside the <title> element will be shown in the To avoid having double borders like in the example above, set the CSS
browser's title bar or in the page's tab. border-collapse property to collapse. This will make the borders collapse
into a single border:
HTML Table Tags

Tag Description

<table> Defines a table

<th> Defines a header cell in a table


All the different form elements are covered in this chapter: HTML Form
Elements.

The <input> Element


Example
The HTML <input> element is the most used form element.
table, th, td {border: 1px solid black; border-collapse: collapse; }
An <input> element can be displayed in many ways, depending on the type
attribute.
With the border-style property, you can set the appearance of the border. The
HTML Input Types
following values are allowed:
Here are the different input types you can use in HTML:
• dotted
• dashed
• solid <input type="button">
• double
<input type="checkbox">
• groove
• ridge <input type="color">
• inset
<input type="date">
• outset
• none <input type="datetime-local">
• hidden
<input type="email">

<input type="file">
HTML Form
<input type="hidden">
An HTML form is used to collect user input. The user input is most often sent to
a server for processing. <input type="image">
The <form> Element <input type="month">
The HTML <form> element is used to create an HTML form for user input: <input type="number">
<form>
. <input type="password">
form elements <input type="radio">
.
</form> <input type="range">
The <form> element is a container for different types of input elements, such
<input type="reset">
as: text fields, checkboxes, radio buttons, submit buttons, etc.
<input type="search">
<input type="submit"> What is CSS?

<input type="tel"> CSS stands for Cascading Style Sheets

<input type="text"> 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
<input type="time"> layout of multiple web pages all at once External stylesheets are
<input type="url"> stored in CSS files
Why Use CSS?
<input type="week">
CSS is used to define styles for your web pages, including the design,
Input Type Text layout and variations in display for different devices and screen sizes.

<input type="text"> defines a single-line text input field. CSS Syntax


Input Type Submit A CSS rule consists of a selector and a declaration block
<input type="submit"> defines a button for submitting form data to a form-
handler. The form-handler is typically a server page with a script for processing
input data. Input Type Reset
<input type="reset"> defines a reset button that will reset all form values to
their default values.

Input Type Button The selector points to the HTML element you want to style.

<input type="button"> defines a button. The declaration block contains one or more declarations separated by
Input Type Color semicolons. Each declaration includes a CSS property name and a value,
The <input type="color"> is used for input fields that should contain a color. separated by a colon.
Depending on browser support, a color picker can show up in the input field. Multiple CSS declarations are separated with semicolons, and
Input Type Date declaration blocks are surrounded by curly braces.

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. Example
You can also use the min and max attributes to add restrictions to dates Input In this example, all <p> elements will be center-aligned, with a red text color:
Type Email
p {color: red; text-align: center;}
The <input type="email"> is used for input fields that should contain an e-mail
address. Example Explained

p is a selector in CSS (it points to the HTML element you want to style: <p>).
color is a property, and red is the property value
text-align is a property, and center is the property value
What is PHP? Variable names are case-sensitive ($age and $AGE are two different variables)

PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-


used, open source scripting language PHP scripts are executed on the PHP Data Types
server
PHP is free to download and use Variables can store data of different types, and different data types can do
different things. PHP supports the following data types:
What is a PHP File?
• String
PHP files can contain text, HTML, CSS, JavaScript, and PHP code • Integer
PHP code is executed on the server, and the result is returned to the • Float (floating point numbers - also called double)
browser as plain HTML PHP files have extension “.php” • Boolean
What Can PHP Do? • Array
• Object
PHP can generate dynamic page content • NULL
• Resource
PHP can create, open, read, write, delete, and close files on the server
PHP can collect form data PHP String
PHP can send and receive cookies
A string is a sequence of characters, like "Hello world!".
PHP can add, delete, modify data in your database PHP can be used
to control user-access A string can be any text inside quotes. You can use single or double quotes:
PHP can encrypt data
PHP Integer
With PHP you are not limited to output HTML. You can output images or PDF
files. You can also output any text, such as XHTML and XML. An integer data type is a non-decimal number between -2,147,483,648 and
2,147,483,647. Rules for integers:
Note: PHP statements end with a semicolon (;).
• An integer must have at least one digit
• An integer must not have a decimal point
PHP Variables • An integer can be either positive or negative
• Integers can be specified in: decimal (base 10), hexadecimal (base 16),
A variable can have a short name (like $x and $y) or a more descriptive name
octal (base 8), or binary (base 2) notation
($age, $carname, $total_volume).

Rules for PHP variables: PHP Float or Decimal

A variable starts with the $ sign, followed by the name of the variable A A float (floating point number) is a number with a decimal point or a number in
variable name must start with a letter or the underscore character A variable exponential form.
name cannot start with a number
PHP Boolean
A variable name can only contain alpha-numeric characters and underscores
(A-z, 0-9, and _ ) A Boolean represents two possible states: TRUE or FALSE.
PHP Array
error_get_last() Returns the last error that occurred
An array stores multiple values in one single variable.
error_log() Sends an error message to a log, to a file, or to a mail
What is an Array? account
error_reporting() Specifies which errors are reported
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. restore_error_handle Restores the previous error handler
r()
restore_exception_ha Restores the previous exception handler
ndler()

PHP Object set_error_handler() Sets a user-defined error handler function

Classes and objects are the two main aspects of object-oriented programming. set_exception_handle Sets a user-defined exception handler function
r()
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 trigger_error() Creates a user-level error message
and behaviors from the class, but each object will have different values
for the properties. user_error() Alias of trigger_error()

PHP NULL Value


PHP Predefined Error and Logging Constants
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. Value Constant Description

Tip: If a variable is created without a value, it is automatically assigned a value 1 E_ERROR Fatal run-time errors. Errors that cannot be
of NULL. Variables can also be emptied by setting the value to NULL: recovered from. Execution of the script is halted
2 E_WARNING Run-time warnings (non-fatal errors). Execution of
the script is not
halted
PHP Error and Logging Functions 4 E_PARSE Compile-time parse errors. Parse errors should
only be generated by the parser
8 E_NOTICE Run-time notices. The script found something that
might be an
Function Description error, but could also happen when running a script
normally
debug_backtrace() Generates a backtrace 16 E_CORE_ERROR Fatal errors at PHP startup. This is like E_ERROR,
except it is generated by the core of PHP
debug_print_backtrac Prints a backtrace 32 E_CORE_WARNI Non-fatal errors at PHP startup. This is like
e()
NG E_WARNING, except it is generated by the core of
error_clear_last() Clears the last error PHP
64 E_COMPILE_ERR Fatal compile-time errors. This is like E_ERROR, 32767 E_ALL Enable all PHP errors and warnings
OR except it is (except E_STRICT in versions < 5.4)
generated by the Zend Scripting Engine
128 E_COMPILE_WA Non-fatal compile-time errors. This is like
RNING E_WARNING, except it is generated by the Zend
Scripting Engine
What is SQL?

SQL is the standard query language for dealing with Relational Databases. SQL
256 E_USER_ERROR Fatal user-generated error. This is like
is used to insert, search, update, and delete database records.
E_ERROR, except it is generated in PHP
code by using the PHP function The MySQL SELECT Statement
trigger_error()
The SELECT statement is used to select data from a database. The data returned
512 E_USER_WARNING Non-fatal user-generated warning.
is stored in a result table, called the result-set. SELECT * FROM table_name;
This is like E_WARNING, except it is
generated in PHP code by using the The MySQL WHERE Clause
PHP function
The WHERE clause is used to filter records.
trigger_error()
1024 E_USER_NOTICE User-generated notice. This is like It is used to extract only those records that fulfill a specified condition.
E_NOTICE, except it is generated in
SELECT * FROM Customers WHERE Country = 'Mexico';
PHP code by using the PHP function
The MySQL AND, OR and NOT Operators
trigger_error()
2048 E_STRICT Enable to have PHP suggest changes to The WHERE clause can be combined with AND, OR, and NOT operators.
your code which will ensure
the best interoperability and forward The AND and OR operators are used to filter records based on more than one
compatibility of your code (Since PHP 5 condition: The AND operator displays a record if all the conditions separated
but not included in E_ALL until PHP 5.4)
by AND are TRUE. The OR operator displays a record if any of the conditions
4096 E_RECOVERABLE_ERROR Catchable fatal error. Indicates that a
separated by OR is TRUE. The NOT operator displays a record if the
probably dangerous error occurred,
condition(s) is NOT TRUE.
but did not leave the Engine in an
unstable state. If the error is not The MySQL INSERT INTO Statement
caught by a user defined handle, the
The INSERT INTO statement is used to insert new records in a table.
application aborts
as it was an E_ERROR (Since PHP 5.2)
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1,
8192 E_DEPRECATED Run-time notices. Enable this to
value2, value3, ...);
receive warnings about code that will
not work in future versions (Since
PHP 5.3) What is a NULL Value?
16384 E_USER_DEPRECATED User-generated warning message. This
is like E_DEPRECATED, A field with a NULL value is a field with no value.
except it is generated in PHP code by
using the PHP function trigger_error() If a field in a table is optional, it is possible to insert a new record or
(Since PHP 5.3) update a record without adding a value to this field. Then, the field will
be saved with a NULL value.
Note: A NULL value is different from a zero value or a field that contains
spaces. A field with a NULL value is one that has been left blank during
record creation! Return Value: Returns a stack trace in the form of an array

IS NULL Syntax

SELECT column_names FROM table_name WHERE column_name IS NULL; IS


NOT NULL Syntax
SELECT column_names FROM table_name WHERE column_name IS NOT NULL;

The MySQL UPDATE Statement

The UPDATE statement is used to modify the existing records in a table.

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

The DELETE statement is used to delete existing records in a table. DELETE


FROM table_name WHERE condition;
Note: Be careful when deleting records in a table! Notice the WHERE clause in
the DELETE statement. The WHERE clause specifies which record(s) should
be deleted. If you omit the WHERE clause, all records in the table will be
deleted

Definition and Usage

The getTrace() method returns a stack trace in the form of an array.

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

You might also like