Anda di halaman 1dari 11

Campus Connect

Chapter-1
INTRODUCTION
1.1 WHAT IS HTML?
HyperText Markup Language (HTML) is the main markup language for creating web
pages and other information that can be displayed in a web browser.
HTML is written in the form of HTML elements consisting of tags enclosed in angle
brackets (like <html>), within the web page content. HTML tags most commonly come in pairs
like <h1> and </h1>, although some tags represent empty elements and so are unpaired, for
example <img>. The first tag in a pair is the start tag, and the second tag is the end tag (they
are also called opening tags and closing tags). In between these tags web designers can add
text, further tags, comments and other types of text-based content.
The purpose of a web browser is to read HTML documents and compose them into visible or
audible web pages. The browser does not display the HTML tags, but uses the tags to interpret
the content of the page.
HTML elements form the building blocks of all websites. HTML allows images and objects to
be embedded and can be used to create interactive forms. It provides a means to
create structured documents by denoting structural semantics for text such as headings,
paragraphs, lists, links, quotes and other items. It can embed scripts written in languages such
as JavaScript which affect the behavior of HTML web pages.

1.1.1 HTML MARKUP


HTML markup consists of several key components, including elements (and their attributes),
character-based data types, character references and entity references. Another important
component is the document type declaration, which triggers standards mode rendering.
The following is an example of the classic Hello world program, a common test employed for
comparing programming languages, scripting languages and markup languages. This example
is made using 9 lines of code:
GCT,Jaipur
1

Campus Connect
Chapter 1

<!DOCTYPE html>
<html>
<head>
<title>This is a title</title>
</head>
<body>
<p>Hello world!</p>
</body>
</html>
(The text between <html> and </html> describes the web page, and the text between <body>
and </body> is the visible page content. The markup text '<title>This is a title</title>' defines
the browser page title.)This Document Type Declaration is for HTML5. If the <!DOCTYPE
html> declaration is not included, various browsers will revert to "quirks mode" for
rendering.HTML documents are composed entirely of HTML elements that, in their most
general form have three components: a pair of tags, a "start tag" and "end tag"; some attributes
within the start tag; and finally, any textual and graphical content between the start and end
tags, perhaps including other nested elements. The HTML element is everything between and
including the start and end tags. Each tag is enclosed in angle brackets.
The

general

form of an HTML element

is

therefore: <tag attribute1="value1"

attribute2="value2">content</tag>. Some HTML elements are defined as empty elements and


take the form <tag attribute1="value1" attribute2="value2" >. Empty elements may enclose no
content, for instance, the BR tag or the inline IMG tag. The name of an HTML element is the
name used in the tags. Note that the end tag's name is preceded by a slash character, "/", and
that in empty elements the end tag is neither required nor allowed. If attributes are not
mentioned, default values are used in each case.

GCT,Jaipur
2

Campus Connect
Chapter 1

1.2 INTRODUCTION TO CSS


Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation
semantics (the look and formatting) of a document written in a markup language. Its most
common application is to style web pages written in HTML and XHTML, but the language can
also be applied to any kind of XML document, including plain XML, SVG and XUL.
CSS is designed primarily to enable the separation of document content (written in HTML or a
similar markup language) from document presentation, including elements such as
the layout, colors, and fonts. This separation can improve content accessibility, provide more
flexibility and control in the specification of presentation characteristics, enable multiple pages
to share formatting, and reduce complexity and repetition in the structural content (such as by
allowing for tableless web design). CSS can also allow the same markup page to be presented
in different styles for different rendering methods, such as on-screen, in print, by voice (when
read out by a speech-based browser or screen reader) and on Braille-based, tactile devices. It
can also be used to allow the web page to display differently depending on the screen size or
device on which it is being viewed.
CSS specifies a priority scheme to determine which style rules apply if more than one rule
matches against a particular element. In this so-called cascade, priorities or weights are
calculated and assigned to rules, so that the results are predictable.
A style sheet consists of a list of rules. Each rule or rule-set consists of one or more selectors,
and a declaration block.In CSS, selectors are used to declare which part of the markup a style
applies to, a kind of match expression.
Selectors may be combined in many ways, especially in CSS 2.1, to achieve great specificity
and flexibility.

1.2.1 Use OF CSS


Prior to CSS, nearly all of the presentational attributes of HTML documents were contained
within the HTML markup; all font colors, background styles, element alignments, borders and
sizes had to be explicitly described, often repeatedly, within the HTML. CSS allows authors to
GCT,Jaipur
3

Campus Connect
Chapter 1

move much of that information to another file, the style sheet, resulting in considerably simpler
HTML.
Headings (h1 elements), sub-headings (h2), sub-sub-headings (h3), etc., are defined structurally
using HTML. In print and on the screen, choice of font, size, color and emphasis for these
elements is presentational.
Prior to CSS, document authors who wanted to assign such typographic characteristics to, say,
all h2 headings had to repeat HTML presentational markup for each occurrence of that heading
type. This made documents more complex, larger, and more difficult to maintain. CSS allows
the separation of presentation from structure. CSS can define color, font, text alignment, size,
borders, spacing, layout and many other typographic characteristics, and can do so
independently for on-screen and printed views. CSS also defines non-visual styles such as the
speed and emphasis with which text is read out by aural text readers.
An "external" CSS file, as described below, can be associated with an HTML document using
the following syntax:
<link href="path/to/file.css" rel="stylesheet">
An internal CSS code can be typed in the head section of the code. The coding is started with
the style tag. For example,
<style type="text/css">
The style sheet with the highest priority controls the content display. Declarations not set in the
highest priority source are passed on to a source of lower priority, such as the user agent style.
This process is called cascading.
One of the goals of CSS is also to allow users greater control over presentation. Someone who
finds red italic headings difficult to read may apply a different style sheet. Depending on the
browser and the web site, a user may choose from various style sheets provided by the
designers, or may remove all added styles and view the site using the browser's default styling,
or may override just the red italic heading style without altering other attributes.

GCT,Jaipur
4

Campus Connect
Chapter 1

CSS has various levels and profiles. Each level of CSS builds upon the last, typically adding
new features and typically denoted as CSS 1, CSS 2, CSS 3, and CSS 4. Profiles are typically a
subset of one or more levels of CSS built for a particular device or user interface. Currently
there are profiles for mobile devices, printers, and television sets. Profiles should not be
confused with media types, which were added in CSS 2.
The first CSS specification to become an official W3C Recommendation is CSS level 1,
published in December 1996.Among its capabilities are support for:- Font properties such as
typeface and emphasis,Color of text, backgrounds, and other elements,Text attributes such as
spacing between words, letters, and lines of text,Alignment of text, images, tables and other
elements,Margin, border, padding, and positioning for most elements,Unique identification and
generic classification of groups of attributes.

1.2.2 LIMITATIONS
Because not all browsers correctly parse CSS code, developed coding techniques known as
CSS hacks can either filter specific browsers or target specific browsers (generally both are
known as CSS filters). The former can be defined as CSS filtering hacks and the latter can be
defined as CSS targeting hacks. Both can be used to hide or show parts of the CSS to different
browsers. This is achieved either by exploiting CSS-handling quirks or bugs in the browser, or
by taking advantage of lack of support for parts of the CSS specifications.Using CSS filters,
some designers have gone as far as delivering different CSS to certain browsers to ensure
designs render as expected. Because very early web browsers were either completely incapable
of handling CSS, or rendered CSS very poorly, designers today often routinely use CSS filters
that completely prevent these browsers from accessing any of the CSS. Internet Explorer
support for CSS began with IE 3.0 and increased progressively with each version. By 2008, the
first Beta of Internet Explorer 8 offered support for CSS 2.1 in its best web standards mode.
Even when the availability of CSS-capable browsers made CSS a viable technology, the
adoption of CSS was still held back by designers' struggles with browsers' incorrect CSS
implementation and patchy CSS support. Even today, these problems continue to make the
business of CSS design more complex and costly than it was intended to be, and cross-browser
testing remains a necessity. Other reasons for the continuing non-adoption of CSS are: its
GCT,Jaipur
5

Campus Connect
Chapter 1

perceived complexity, authors' lack of familiarity with CSS syntax and required techniques,
poor support from authoring tools, the risks posed by inconsistency between browsers and the
increased costs of testing.
Some noted limitations of the current capabilities of CSS include:

Selectors are unable to ascend


Lack of column declaration
Cannot explicitly declare new scope independently of position

1.2.3 TYPES OF CSS


There are three ways of inserting a style sheet:
External Style Sheet
An external style sheet is ideal when the style is applied to many pages. With an external style
sheet, you can change the look of an entire Web site by changing one file. Each page must link
to the style sheet using the <link> tag. The <link> tag goes inside the <head> section:
<head>
<linkrel="stylesheet"type="text/css"href="mystyle.css"/>
</head>
Internal Style Sheet
An internal style sheet can be used if one single document has a unique style. Internal styles are
defined in the <head> section of an HTML page, by using the <style> tag, like this:
<head>
<styletype="text/css">
body{background-color:yellow}
p{color:blue}
</style>
</head>

GCT,Jaipur
6

Campus Connect
Chapter 1

Inline Styles
An inline style can be used if a unique style is to be applied to one single occurrence of an
element.To use inline styles, use the style attribute in the relevant tag. The style attribute can
contain any CSS property. The example below shows how to change the text color and the left
margin of a paragraph:
<p style="color:blue;margin-left:20px">This is a paragraph.</p>

1.3 My SQL
MySQL officially, but also called "My Sequel") is (as of July 2013) the world's most widely
used open-source relational database management system (RDBMS) that runs as a server
providing multi-user access to a number of databases, thoughSQLite probably has more total
embedded deployments. It is named after co-founder Michael Widenius's daughter,
My.The SQL phrase stands for Structured Query Language.
MySQL is a popular choice of database for use in web applications, and is a central component
of

the

widely

other 'AMP' stacks).

used LAMP open


LAMP

source
is

an

web

application
acronym

software
for

stack

(and

"Linux, Apache,

MySQL, Perl/PHP/Python." Free-software-open source projects that require a full-featured


database management system often use MySQL.

1.4 INTRODUCTION TO PHP


PHP is a server-side scripting language designed for web development but also used as
a general-purpose programming language.While PHP originally stood for Personal Home
Page, it now stands for PHP: Hypertext Preprocessor, a recursive acronym.
PHP code is interpreted by a web server with a PHP processor module, which generates the
resulting web page: PHP commands can be embedded directly into an HTML source document
rather than calling an external file to process data. It has also evolved to include a commandGCT,Jaipur
7

Campus Connect
Chapter 1

line interface capability and can be used in standalone graphical applications.

1.4.1 SYNTAX
The following Hello world program is written in PHP code embedded in an HTML document:
<!DOCTYPE html>
<meta charset="utf-8">
<title>PHP Test</title>
<?php
echo 'Hello World';
?>
However as PHP does not need to be embedded in HTML, or used with a web server, the
simplest version of a Hello World program can be written like this:
<?= 'Hello world';
The PHP interpreter only executes PHP code within its delimiters. Anything outside its
delimiters is not processed by PHP (although non-PHP text is still subject to control
structures described in PHP code) . The purpose of all these delimiters is to separate PHP code
from non-PHP code, including HTML.
Variables are prefixed with a dollar symbol, and a type does not need to be specified in
advance. Unlike function and class names, variable names are case sensitive. Both doublequoted ("") and here doc strings provide the ability to interpolate a variable's value into the
string. PHP treats newlines as whitespace in the manner of a free-form language (except when
inside string quotes), and statements are terminated by a semicolon. PHP has three types
of comment syntax: /* */ marks block and inline comments; // as well as # are used for one-line
comments. The echo statement is one of several facilities PHP provides to output text, e.g., to a
web browser.
In terms of keywords and language syntax, PHP is similar to most high level languages that
follow the C style syntax. if conditions, for and while loops, and function returns are similar in
syntax to languages such as C, C++, C#, Java and Perl.
GCT,Jaipur
8

Campus Connect
Chapter 1

1.4.2 DATA TYPES


PHP stores whole numbers in a platform-dependent range, either a 64-bit or 32bit signed integer equivalent to the C-language long type. Unsigned integers are converted to
signed values in certain situations; this behavior is different from other programming
languages.Integer

variables

can

be

assigned

using

decimal

(positive

and

negative), octal, hexadecimal, and binarynotations. Floating point numbers are also stored in a
platform-specific range. They can be specified using floating point notation, or two forms
of scientific notation. PHP has a native Boolean type that is similar to the native Boolean types
in Java and C++. Using the Boolean type conversion rules, non-zero values are interpreted as
true and zero as false, as in Perl and C++. The null data type represents a variable that has no
value. The only value in the null data type is NULL. Arrays can contain elements of any type
that PHP can handle, including resources, objects, and even other arrays. Order is preserved in
lists of values and in hashes with both keys and values, and the two can be intermingled. [ PHP
also supports strings, which can be used with single quotes, double quotes, nowdoc
or heredoc syntax.

1.4.3 FUNCTIONS
PHP has hundreds of base functions and thousands more via extensions. These functions are
well documented on the PHP site; however, the built-in library has a wide variety of naming
conventions and inconsistencies. PHP currently has no functions for thread programming,
although it does support multi process programming on POSIX systems.
In PHP 5.2 and earlier, functions are not first-class functions and can only be referenced by
their name, directly or dynamically by a variable containing the name of the function. Userdefined functions can be created at any time without being prototyped. Functions can be
defined inside code blocks, permitting a run-time decision as to whether or not a function
should be defined. Function calls must use parentheses, with the exception of zero argument
GCT,Jaipur
9

Campus Connect
Chapter 1

class constructor functions called with the PHP new operator, where parentheses are optional.
PHP supports quasi-anonymous functions through the create_function() function, although
they are not true anonymous functions because anonymous functions are nameless, but
functions

can

only

be

referenced

by

name,

or

indirectly

through

variable $function_name();, in PHP.

1.4.4 OBJECTS
Basic object-oriented programming functionality was added in PHP 3 and improved in PHP
4. Object handling was completely rewritten for PHP 5, expanding the feature set and
enhancing performance. In previous versions of PHP, objects were handled like value
types. The drawback of this method was that the whole object was copied when a variable was
assigned or passed as a parameter to a method. In the new approach, objects are referenced
by handle, and not by value. PHP 5 introduced private and protected member variables and
methods, along with abstract classes, final classes, abstract methods, and final methods. It also
introduced a standard way of declaring constructors and destructors, similar to that of other
object-oriented languages such as C++, and a standard exception handling model. Furthermore,
PHP 5 added interfaces and allowed for multiple interfaces to be implemented. There are
special interfaces that allow objects to interact with the runtime system. Objects implementing
Array Access can be used with array syntax and objects implementing Iterator or Iterator
Aggregate can be used with the for each language construct. There is no virtual table feature
in the engine, so static variables are bound with a name instead of a reference at compile time.

1.4.5 USES
PHP is a general-purpose scripting language that is especially suited to server-side web
development where PHP generally runs on a web server. Any PHP code in a requested file
is executed by the PHP runtime, usually to createdynamic web page content or dynamic images
used on websites or elsewhere. It can also be used for command-linescripting and clientside graphical user interface (GUI) applications. PHP can be deployed on most web servers,
many operating systems and platforms, and can be used with many relational database
GCT,Jaipur
10

Campus Connect
Chapter 1

management systems (RDBMS). Most web hosting providers support PHP for use by their
clients. It is available free of charge, and the PHP Group provides the complete source code for
users to build, customize and extend for their own use.
PHP acts primarily as a filter, taking input from a file or stream containing text and/or PHP
instructions and outputting another stream of data.Since PHP 4, the PHP parser compiles input
to produce bytecode for processing by the Zend Engine, giving improved performance over
its interpreter predecessor.
Originally designed to create dynamic web pages, PHP now focuses mainly on server-side
scripting, and it is similar to other server-side scripting languages that provide dynamic content
from a web server to a client.

GCT,Jaipur
11

Anda mungkin juga menyukai