Escolar Documentos
Profissional Documentos
Cultura Documentos
WHAT IS PHP?
WHAT YOU CAN DO WITH PHP
ADVANTAGES OF PHP
GETTING STARTED WITH PHP
STANDARD PHP SYNTAX
DATA TYPES IN PHP
OPERATORS IN PHP
CONCEPT OF ARRAY IN PHP
GETTING STARTED WITH HTML
WHAT IS CSS?
USING SQL
1. What is PHP?
PHP stands for preprocessor hypertext page.
PHP is a powerful and widely used open source
server-side scripting language to generate a web
page.
PHP scripts are executed on the server and the result
is sent to the browser as plain HTML.
PHP can be integrated with number of popular
database, including MySQL,Oracle etc.
PHP can be embedded within normal HTML web
pages.
3. Advantages of PHP
Easy to learn: PHP is easy to learn and use. For
beginner programmers who just started out in web
development, PHP is often considered as the best
and preferable choice of scripting language to learn.
Open source: PHP is an open source project-the
language is developed and maintained by a
worldwide community of developers who makes its
source code freely available to download and use.
There are no costs associated with using PHP for
individual or commercial projects, including future
updates.
Portability: PHP runs on various platforms such as
Microsoft Windows, Linux, Mac OS, etc. and it is
compatible with almost all servers used today such
Apache , IIS, etc.
Fast Performance: Scripts written in PHP usually
execute faster than those written in other scripting
like APS.NET or JSP.
Vast Community: Since PHP is supported by the
worldwide community, finding help or
documentation for PHP online is extremely easy.
Install XAMP/WAMP/LINUX.
Install net beans.
7. OPERATORS IN PHP
There are set of symbols which are used to perform
some operations.
ARITHMETIC OPRATOR-which is used to
add(+),subtract(-),multiply(*),divide(/),modulus(%) .
RELATIONAL/COMPARISION-are used to give relation
or comparison of two values with each other like
smaller than(<),greater than(>),smaller or equal
to(<=),greater or equal to(>=),equal to(==),not equal
to(!=).
ASSIGNMENT OPERATOR it is used to assign the
value to the variable like increment equal
to(+=),decrement equal to(-=),multiply equal
to(*=),divide equal to(/=).
INCREMENT/DECREMENT- increment (++) is used to
increase any value by 1.
Decrement (--) is used to decrease any value by 1.
CONDITIONAL/TERNARY-it will check for given
condition if condition is true expression 1 get
executed otherwise expression 2 get executed like
(Condition?expression1:expression2);
LOGICAL-these are used to combine two or more
conditions and get a common output. And symbols
are logical and (&&), logical or (||), logical not (!).
SPECIAL-these are special purpose operators which
are rarely used. Concatenate(.),associative(=>) and
reference(->)
8. CONCEPT OF ARRAY IN PHP
ARRAY:
It is the collection of mixed types of data and values
or we can say an array is a data structure that stores
one more similar type of values in a single value. For
example if we want to store 100 numbers then
instead of defining 100 variables its easy to define
an array of 100 lengths.
There are three different kinds of arrays and each
array value is accessed using an ID c which is called
array index.
Numeric array- An array with a numeric index.
Values are stored and accessed in linear fashion.
These arrays can store numbers, strings, and any
object but their index will be represented by
numbers. By default array index starts from zero.
EXAMPLE:
<html>
<body>
<?php
$numbers[0] = "one";
$numbers[1] = "two";
$numbers[2] = "three";
$numbers[3] = "four";
$numbers[4] = "five";
?>
</body>
</html>
Value is 1
Value is 2
Value is 3
Value is 4
Value is 5
Value is one
Value is two
Value is three
Value is four
Value is five
EXAMPLE:
<html>
<body>
<?php
$salaries['mohammad'] = "high";
$salaries['qadir'] = "medium";
$salaries['zara'] = "low";
?>
</body>
</html>
<html>
<body>
<?php
$marks = array(
"mohammad" => array (
"chemistry" => 39
),
"chemistry" => 29
),
"chemistry" => 39
);
/* Accessing multi-dimensional array values
*/
?>
</body>
</html>
8.1.SYNTAX OF HTML
TAG/SYNTAX SHORT DESCRIPTION
<html></html> Main container.
<p> Paragraph.
EXAMPLE :
<HTML>
<HEAD>
<TITLE>Your Title Here</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<CENTER><IMG SRC="clouds.jpg" ALIGN="BOTTOM"> </CENTER>
<HR>
<a href="http://somegreatsite.com">Link Name</a>
is a link to another nifty site
<H1>This is a Header</H1>
<H2>This is a Medium Header</H2>
Send me mail at <a href="mailto:support@yourcompany.com">
support@yourcompany.com</a>.
<P> This is a new paragraph!
<P> <B>This is a new paragraph!</B>
<BR> <B><I>This is a new sentence without a paragraph break, in bold
italics.</I></B>
<HR>
</BODY>
</HTML>
And the result of the above programming is:
9.WHAT IS CSS?
CSS stands for cascading style sheets.
CSS describes how HTML elements are to be
displayed on screen, 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 style and layout web pages-for
example, to alter the font, colour, size and spacing of
content, split into multiple columns, add animations
and other decorative features.
CSS contain two main parts i.e. selector and
declaration.
10.1.SYNTAX OF MYSQL
For creating table:
create table tablename(columnname
datatype(size),columnname datatype(size),columnname
datatypes(size);
For dropping table:
drop table tablename;
alter table tablename drop columnname;
For altering table:
alter table tablename add new columnname
datatypes(size);
alter table tablename modify columnname
newdatatypes(new size);
For inserting table:
Partial insert:-
insert into tablename(columnname)
values(value1,value2);
Full insert:-
Insert into tablename(value1,value2,value3);
For deleting table:
delete from tablename where condition;
For updating table:
update tablename set columnname=new value where
condition;
For selecting table:
Select * from the table;
Select * from the tablename where condition;
Select columnname,columnname from tablename where
condition;
REFRENCES:
1. www.google.com
2. www.wikipedia.com.