Vous êtes sur la page 1sur 38

CHAPTER 1

INTRODUCTION AND LITERATURE REVIEW


1.1 Introduction
The project is about sale and purchase of secondhand products online. The user can
upload his/her product ad online free of cost to sale it.After creating an account the
user can purchase and sale product online.
Secondhand sale and purchase of products is the use for a user to sale his secondhand
product online or for a user to purchase a secondhand product online free of cost. This
project basically consist of four categories like car , bike, mobiles ,house. All the
different category consist of different attributes.
Objectives

Allows user to post free ad of his/her secondhand product online.

Allows user to buy a secondhand product online.

Convenience
The look and feel of the project must be simple. To achieve this facility, we have
designed our project in such a way that user feels himself /herself convenient while
dealing with it.
Security
Security must be implemented in every project so that data can be protected from
unauthorized access. In our project, oneuser cant see or access the data of any other
user. He/ she can only see his /her data & even cant modify his data without
administrators permission.
1.2 Literature Review
SECOND HAND SALE AND PURCAHSE OF PRODUCTS
olx Is online classifieds marketplace for used goods such as bike, cars items,
motorcycles, mobile phones, property and much more. It is accessible through
the internet and through native apps on smartphones.

CHAPTER 2
THEORETICAL STUDY
1.4 PROJECT TOOLS, PLATFORMS AND LANGUAGES USED
Front End
PHP is used as front-end for the Jobs application. The PHP is used for server side
processing on the web server. PHP is a set of components that provide developers
with a framework to implement complex functionality. PHP provides state services
that can be utilized to manage session variables across multiple Web servers in a
server form. The programming language used in development of project is php.
Back End
MySQL is one of the leading database management systems available on the market
today. In this data is stored in the form of tables which can be created and
manipulated by using various commands. The database itself has been redesigned to
automatically perform many tuning functions, leaving you free to focus on most
important tasks.

2.1 Data Flow Diagram

About Us

Home Page

User
Registration

Login

Contact Us

Site Map
Figure No2.1 :dfd

Post free
Ad

User

Login

Buy a product

Figure No 2.1.2 :dfd

Question
Security

User Forget
Password

Not valid
Change
3
Password

Figure No 2.1.3 :dfd

2.2 DATA BASE DESIGN

2.2.1. Register

Field

Type

Key

Id
Name
Password
Email
Security
Answer
I_am

Int(10)
varchar(10)
varchar(12)
varchar(30)
varchar(30)
varchar(30)
Varchar(30)

Primary
----------Unique
----------------

Field
Id

Type

Key

Int

Primary

Em

varchar(33)

Unique

ail
Make

Varchar(50)

------

Model

Varchar(20)

------

Year

Varchar(20)

------

Mileage

Varchar(50)

------

Adtitle

Varchar(20)

-------

Address

Varchar(20)

-------

Price

Varchar(20)

-------

Photo

Varchar(100)

-------

Description

Varchar(100)

-------

Phoneno

Varchar(20)

-------

2.2.2 Bike

2.2.3 Car

Field
Id

Type

Key

Int

Primary

Em

varchar(33)

Unique

ail
Make

varchar(50)

------

Model

Varchar(20)

------

Year

Varchar(20)

------

Mileage

Varchar(50)

------

Adtitle

Varchar(20)

-------

Address

Varchar(20)

-------

Price

Varchar(20)

-------

Photo

Varchar(100)

-------

Description

Varchar(100)

-------

Phoneno

Varchar(20)

-------

Field
Id

Type

Key

Int

Primary

Em

varchar(33)

Unique

ail
Make

varchar(20)

------

Model

Varchar(20)

------

Adtitle

Varchar(20)

-------

Address

Varchar(20)

-------

Price

Varchar(20)

-------

Photo

Varchar(100)

-------

Description

Varchar(100)

-------

Phoneno

Varchar(20)

-------

2.2.4. Mobile

2.2.5. House

Field
Id

Type

Key

Int

Primary

Em

varchar(33)

Unique

ail
Bathroom
Bedroom

varchar(20)
Varchar(20)

-----------

Squaremeters

Varchar(50)

------

Adtitle

Varchar(20)

-------

Address

Varchar(20)

-------

Price

Varchar(20)

-------

Photo

Varchar(100)

-------

Description

Varchar(100)

-------

Phoneno

Varchar(20)

-------

Field
Id

Type

Key

varchar(33)

Primary

Em

varchar(33)

Unique

ail
Subject

varchar(30)

------

Name

Varchar(30)

------

Contact

Varchar30)

------

Description

Varchar(50)

------

2.2.6.Contact us

CHAPTER 3
EXPERIMANTAL STUDY

3.1 HTML (Hyper Text Markup Languages)


3.1.1

What is HTML?
HTML stands for Hyper Text Markup Language

3.1.2

HTML Element

3.1.3

3.1.5

An HTML element is everything from the start tag to the end tag
Start tagElement contentEnd tag
<p>This is a paragraph</p>
<a href="default.htm" >This is a link</a>

HTML Element Syntax

3.1.4

HTML is not a programming language, it is a markup language


A markup language is a set of markup tags
HTML uses markup tags to describe web pages
HTML markup tags are usually called HTML tags
HTML tags are keywords surrounded by angle brackets like <html>
HTML tags normally come in pairs like and </ <b> b>
The first tag in a pair is the start tag, the second tag is the end tag
Start and end tags are also called opening tags and closing tags .

An HTML element starts with a start tag


An HTML element ends with an end tag
The element content is everything between the start and end tag
Some HTML elements have empty content
Some HTML elements have a missing end tag.

Nested HTML Elements

Most HTML elements can be nested (can contain other HTML elements).

Most HTML documents consist of nested HTML elements.

HTML Headings
HTML headings are defined with the <h1> to <h6> tags.
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
Note: Use the HTML heading tags for headings only. Don't use headings to make
something BIG or bold.

3.1.6

HTML Paragraphs
HTML paragraphs are defined with the <p> tag.
<p>This is a paragraph</p>
<p>This is another paragraph</p>

3.1.7 HTML Links


HTML links are defined with the <a> tag.
<a href="http://www.netmaxtech.com">This is a link</a>
Note: The <a> tag contains an attribute (href) to provide the link address.

3.1.8

HTML Attribute

Attributes provide additional information about HTML elements.

HTML elements can have attributes

Attributes provide additional information about the element

Attributes are always specified in the start tag

Attribute Syntax
Attributes always come in name/value pairs like this: name="value".

Examples
border="1"
href="http://www.netmaxtech.com"
bgcolor="yellow"

Attributes Example 1:
<table> defines an HTML table. (You will learn more about HTML tables later)
<table border="1">

The border attribute defines a border type for the <table> element.

3.1.9 LISTS
HTML supports ordered, unordered and definition lists.

3.1.9.1 Unordered Lists

An unordered list is a list of items. The list items are marked with bullets
(typically small black circles).

An unordered list starts with the <ul> tag. Each list item starts with the <li>
tag.

3.1.9.2 Ordered Lists

An ordered list is also a list of items. The list items are marked with numbers.

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.

3.1.9.3 Definition Lists

A definition list is not a list of items. This is a list of terms and explanation of
the terms.

A definition list starts with the <dl> tag. Each definition-list term starts with
the <dt> tag. Each definition-list definition starts with the <dd> tag.

3.1.10 Frames

With frames, you can display more than one HTML document in the same
browser window, and each frame is independent of the others.

The disadvantages of using frames are:

The web developer must keep track of more HTML documents

It is difficult to print the entire page

3.1.10.1 The Frameset Tag

The <frameset> tag defines how to divide the window into frames

10

Each frameset defines a set of rows or columns

The values of the rows/columns indicate the amount of screen area each
row/column will occupy

3.1.10.2.1 The Frame Tag


The<frame> tag defines what HTML document to put into each frame
In the example below we have a frameset with two columns. The first column
= 25% of the total width.The second column =75% of the total width. The
HTML document "frame_a.htm" is put into the first column, and the HTML
document "frame_b.htm" is put into the second column.
<frameset cols="25%,75%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
</frameset>

3.1.11 CASCADING STYLE SHEET (CSS)


CSS is a style sheet language used to describe the presentation semantics (that is, 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.
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 table less 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. While the author of a document typically links that document to a CSS style
sheet, readers can use a different style sheet, perhaps one on their own computer, to override
the one the author has specified.

11

CSS stands for Cascading Style Sheets

Styles define how to display HTML elements

Styles were added to HTML 4.0 to solve a problem

External Style Sheets can save a lot of work

External Style Sheets are stored in CSS files

Example for CSS:


<html>
<head><style type = text/css>{Background-color: #b4c4de;}
</style>
</head>

3.1.11.1 What CSS can do?


CSS is a style language that defines layout for an entire web site or any HTML document.
For example, CSS covers colors, fonts, headings, margins, lines, breaks, height, width,
background images, advanced positions and many other things.
HTML can be misused to add layout to websites or it can be create trouble for layout. HTML
can define layout for any page or website but HTML is not for layout designing. So
Cascading Style Sheet offers more options and is more accurate and sophisticated. Because
the CSS is exclusive for design layout of website. CSS is supported by all browsers today.

3.1.11.2 Difference between CSS and HTML:CSS is used exclusively for formatting structured content of a single web page or the entire
web site. HTML is used to structure content or website.
Tim Berners Lee invented the World Wide Web, the language HTML was only used to add
structure to text. An author could mark his text by stating "this is a headline" or "this is a
paragraph" using HTML tags such as <h1> and <p>.
As the Web gained popularity, designers started looking for possibilities to add layout to
online documents. To meet this demand, the browser producers (at that time Netscape and
Microsoft) invented new HTML tags such as for example <font> which differed from the

12

original HTML tags by defining layout - and not structure. This also led to a situation where
original structure tags such as <table> were increasingly being misused to layout pages
instead of adding structure to text. Many new layout tags such as <blink> were only
supported by one type of browser.
Cascading Style Sheet was invented to remedy this situation by providing web designers with
sophisticated layout opportunities supported by all browsers.

3.1.11.3 ADVANTAGES OF CSS:


1. CSS saves time: When most of us first learn HTML, we get taught to set the font
face, size, color, style etc every time it occurs on a page. This means we find
ourselves typing (or copying & pasting) the same thing over and over again. With
CSS, you only have to specify these details once for any element.
2. Pages load faster
Less code means faster download times.
3. Easy maintenance
To change the style of an element, you only have to make an edit in one place.
4. Superior styles to HTML
CSS has a much wider array of attributes than HTML.

3.1.11.4 DISADVANTAGES OF CSS:


1. Browser compatibility: Browsers have varying levels of compliance with Style
Sheets. This means that some Style Sheet features are supported and some aren't.
To confuse things more, some browser manufacturers decide to come up with
their own proprietary tags.
2. Different syntax to HTML: CSS was developed independently of HTML and
uses a different syntax, so a web developer has to learn two sets of formatting
syntax instead of one. CSS syntax is also rather clumsy and user-unfriendly.
3. Requires access to external files: If you save an HTML file on disk without the
associated style sheet then it wil lose its formatting when you look at it offline.
Similarly, any pages which depend on a web-level sheet will lose their formatting
if access to the web-level sheet site is lost. Similarly, all material linked to from a
CSS file (images, for instance) must be available for the CSS to work properly.

13

4. Can easily be overridden: Because CSS is an open text-based system there is no


security built in, and anyone with read/write access to a website can disrupt the
formatting by changing the CSS files or altering the links in the webpages.
5. Complicates templates: CSS files are particularly troublesome within authoring
packages which use templates, like Dreamweaver, since a CSS link that works
within the template may not necessarily work when the template is used to create
a web page.

3.2

JAVASCRIPT

3.2.1 What is JavaScript?

license. JavaScript was designed to add interactivity to HTML pages

JavaScript is a scripting language

A scripting language is a lightweight programming language

JavaScript is usually embedded directly into HTML pages

JavaScript is an interpreted language (means that scripts execute without


preliminary compilation)

Everyone can use JavaScript without purchasing a

3.2.2 Are Java and JavaScript the Same?


NO!Java and JavaScript are two completely different languages in both concept
an design! Java(developed by Sun Microsystems) is a powerful and much more
complex programming language - in the same category as C and C++.

3.2.3 What can a JavaScript Do?

JavaScript gives HTML designers a programming tool - HTML authors are


normally not programmers, but JavaScript is a scripting language with a very

14

simple syntax! Almost anyone can put small "snippets" of code into their HTML
pages.

JavaScript can react to events - A JavaScript can be set to execute when


something happens, like when a page has finished loading or when a user clicks
on an HTML element

JavaScript can read and write HTML elements - A JavaScript can read and
change the content of an HTML element

JavaScript can be used to validate data - A JavaScript can be used to validate


form data before it is submitted to a server. This saves the server from extra
processing

JavaScript can be used to detect the visitor's browser - A JavaScript can be


used to detect the visitor's browser, and - depending on the browser - load another
page specifically designed for that browser

The Real Name is ECMAScript. A JavaScript can read and change the content of
an HTML element

A JavaScript can be used to validate form data before it is submitted to a server.


This saves the server from extra processing9

A JavaScript can be used to detect the visitor's browser, and - depending on the
browser - load another page specifically designed for that browser

JavaScript's official name is "ECMAScript". The standard is developed and maintained by the
ECMA organisation.The language was invented by Brendan Eich at Netscape (with Navigator
2.0), and has appeared in all Netscape and Microsoft browsers since 1996.The development
of ECMA-262 started in 1996, and the first edition of was adopted by the ECMA General
Assembly in June 1997.The standard was approved as an international ISO (ISO/IEC 16262)
standard in 1998.The development of the standard is still in progress.
Java Script

<html>
<body>
<h1>My First Heading</h1>

15

<p>My first paragraph.</p>


</body>
</html>
The HTML <script> tag is used to insert a JavaScript into an HTML page.

3.2.4 How to Put a JavaScript Into an HTML Page


<html>
<body>
<script type="text/javascript">
document.write("Hello World!");
</script>
</body>
</html>
The code above will produce this output on an HTML page:
Hello World!

3.2.5 JavaScript Statements


A JavaScript statement is a command to the browser. The purpose of the command is to tell
the browser what to do.This JavaScript statement tells the browser to write "Hello Dolly" to
the web page:
document.write("Good Morning");
It is normal to add a semicolon at the end of each executable statement. Most people think
this is a good programming practice, and most often you will see this in JavaScript examples
on the web.The semicolon is optional (according to the JavaScript standard), and the browser
is supposed to interpret the end of the line as the end of the statement. Because of this you
will often see examples without the semicolon at the end.
Note: Using semicolons makes it possible to write multiple statements on one line.
3.2.6 JavaScript Variable
As with algebra, JavaScript variables are used to hold values or expressions. A variable can
have a short name, like x, or a more descriptive name, like carname. Rules for JavaScript
variable names:

Variable names are case sensitive (y and Y are two different variables)

16

Variable names must begin with a letter or the underscore character

3.3PHP(PHP Hypertext Preprocessor)

3.3.1 INTRODUCTION TO PHP


PHP is a powerful server-side scripting language for creating dynamic and Interactive
websites. PHP is the widely-used, free, and efficient alternative to competitors such as
Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded
directly into the HTML code.
The PHP syntax is very similar to Perl and C. PHP is often used together with Apache
(web server) on various operating systems. It also supports ISAPI and can be use with
Microsoft's IIS on Windows. PHP is a server-side scripting language.
3.3.2 What is PHP?

PHP stands for PHP: Hypertext Preprocessor.

PHP is a server-side scripting language, like ASP.

PHP scripts are executed on the server.

PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid,


PostgreSQL, Generic ODBC, etc.).

PHP is an open source software.

PHP is free to download and use.

3.3.3 What do You Need?


If your server supports PHP you don't need to do anything. Just create some .php files in your
web directory, and the server will parse them for you. Because it is free, most web hosts offer

17

PHP support.However, if your server does not support PHP, you must install PHP.Here is a
link to a good tutorial from PHP.net on how to install PHP5:

Download PHP: Download PHP for free


Download Apache Server: Download Apache for free

3.3.4 Basic PHP Syntax


A PHP scripting block always starts with <?php and ends with ?>. A PHP scripting block can
be placed anywhere in the document.On servers with shorthand support enabled you can start
a scripting block with <? and end with ?>.For maximum compatibility, we recommend that
you use the standard form (<?php) rather than the shorthand form.
<?php
?>
A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting
code.Below, we have an example of a simple PHP script which sends the text "Hello World"
to the browser:
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to
distinguish one set of instructions from another.There are two basic statements to output text
with PHP: echo and print. In the example above we have used the echo statement to output
the text "Hello World".

3.3.5 Comments in PHP


In PHP, we use // to make a single-line comment or /* and */ to make a large
comment block.
<html>
<body>
<?php
18

//This is a comment
/*
This is
a comment
block
*/
?>
</body>
</html>
Variables are used for storing values, such as numbers, strings or function results, so
that they can be used many times in a script.
3.3.6 Variables in PHP
Variables are used for storing a values, like text strings, numbers or arrays.When a
variable is set it can be used over and over again in your script.All variables in PHP
start with a $ sign symbol.The correct way of setting a variable in PHP:
$var_name = value;
New PHP programmers often forget the $ sign at the beginning of the variable. In that
case it will not work.Let's try creating a variable with a string, and a variable with a
number:
<?php
$txt = "Hello World!";
$number = 16;
?>

3.3.7 PHP is a Loosely Typed Language


In PHP a variable does not need to be declared before being set.In the example above, you see
that you do not have to tell PHP which data type the variable is.PHP automatically converts
the variable to the correct data type, depending on how they are set.In a strongly typed
programming language, you have to declare (define) the type and name of the variable before
using it.In PHP the variable is declared automatically when you use it.

19

3.3.8Variable Naming Rules

A variable name must start with a letter or an underscore "_"

A variable name can only contain alpha-numeric characters and underscores (a-z, AZ, 0-9, and _ )

A variable name should not contain spaces. If a variable name is more than one word,
it should be separated with underscore ($my_string), or with capitalization
($myString)

A string variable is used to store and manipulate a piece of text.

3.3.9 Strings in PHP


String variables are used for values that contains character strings.In this tutorial we are
going to look at some of the most common functions and operators used to manipulate strings
in PHP.After we create a string we can manipulate it. A string can be used directly in a
function or it can be stored in a variable.
Below, the PHP script assigns the string "Hello World" to a string variable called $txt:
<?php
$txt="Hello World";
echo $txt;
?>
The output of the code above will be:
Hello World
Now, lets try to use some different functions and operators to manipulate our string.
3.3.10 The Concatenation Operator
There is only one string operator in PHP.

The concatenation operator (.) is used to put two string values together.
To concatenate two variables together, use the dot (.) operator:

<?php
$txt1="Hello World";
$txt2="1234";
echo $txt1 . " " . $txt2;
?>

20

The output of the code above will be:


Hello World 1234
If we look at the code above you see that we used the concatenation operator two times. This
is because we had to insert a third string. Between the two string variables we added a string
with a single character, an empty space, to separate the two variables.
3.3.11 PHP Operators
This section lists the different operators used in PHP.
TABLE(1) : Arithmetic Operators
Operator

Description

Example

Result

Addition

x=2
x+2

Subtraction

x=2
5-x

Multiplication

x=4
x*5

20

Division

15/5
5/2

3
2.5

Modulus (division remainder)

5%2
10%8
10%2

1
2
0

++

Increment

x=5
x++

x=6

--

Decrement

x=5
x--

x=4

TABLE (2) : Assignment Operators


Operator

Example

Is The Same As

x=y

x=y

+=

x+=y

x=x+y

-=

x-=y

x=x-y

*=

x*=y

x=x*y

/=

x/=y

x=x/y

21

.=

x.=y

x=x.y

%=

x%=y

x=x%y

TABLE(3) : Comparison Operators


Operator

Description

Example

==

is equal to

5==8 returns false

!=

is not equal

5!=8 returns true

>

is greater than

5>8 returns false

<

is less than

5<8 returns true

>=

is greater than or equal to

5>=8 returns false

<=

is less than or equal to

5<=8 returns true

TABLE(4) : Logical Operators


Operator
Description

Example

&&

And

x=6,y=3 ,(x < 10 && y > 1) returns true

||

Or

x=6,y=3
(x==5 || y==5) returns false

Not

x=6,y=3
!(x==y) returns true

The if, elseif and else statements in PHP are used to perform different actions based on
different conditions

Conditional Statements
Very often when you write code, you want to perform different actions for different decisions.
You can use conditional statements in your code to do this.

if...else statement - use this statement if you want to execute a set of code when a
condition is true and another if the condition is not true

elseif statement - is used with the if...else statement to execute a set of code if one of
several condition are true

The If...Else Statement:If you want to execute some code if a condition is true and another
code if a condition is false, use the if....else statement.
Syntax
if (condition)
code to be executed if condition is true;
else
code to be executed if condition is false;

22

Example: The following example will output "Have a nice weekend!" if the current day is
Friday, otherwise it will output "Have a nice day!":
<html>
<body>
<?php
$d=date("D");
if ($d=="Fri")
echo "Have a nice weekend!";
else
echo "Have a nice day!";
?>
</body>
</html>
If more than one line should be executed if a condition is true/false, the lines should be
enclosed within curly braces
<html>
<body>
<?php
$d=date("D");
if ($d=="Fri")
{
echo "Hello!<br />";
echo "Have a nice weekend!";
echo "See you on Monday!";
}
?>
</body>
</html>
The ElseIf Statement
If you want to execute some code if one of several conditions are true use the elseif statement
Syntax
if (condition)
code to be executed if condition is true;
elseif (condition)
code to be executed if condition is true;else

23

code to be executed if condition is false;


EXAMPLE:The following example will output "Have a nice weekend!" if the current day is
Friday, and "Have a nice Sunday!" if the current day is Sunday. Otherwise it will output
"Have a nice day!"
<html>
<body>
<?php
$d=date("D");
if ($d=="Fri")
echo "Have a nice weekend!";
elseif ($d=="Sun")
echo "Have a nice Sunday!";
else
echo "Have a nice day!";
?>
</body>
</html>
3.3.12PHP Functions
In this tutorial we will show you how to create your own functions. Create a PHP Function:A
function is a block of code that can be executed whenever we need it.Creating PHP functions:

All functions start with the word "function()"

Name the function - It should be possible to understand what the function does by its
name. The name can start with a letter or underscore (not a number)

Add a "{" - The function code starts after the opening curly brace

Insert the function code

Add a "}" - The function is finished by a closing curly brace

Example:A simple function that writes my name when it is called:


<html><body>
<?php
functionwriteMyName()
{

24

echo "Kai Jim Refsnes";


}
writeMyName();
?>
</body>
</html>
Use a PHP Function: Now we will use the function in a PHP script:
<html>
<body>
<?php
functionwriteMyName()
{
echo "Sachin";
}
echo "Hello world!<br />";
echo "My name is ";
writeMyName();
echo ".<br />That's right, ";
writeMyName();
echo " is my name.";
?>
</body>
</html>
The output of the code above will be:
Hello world!
My name is Sachin.
PHP Functions - Adding parameters
Our first function (writeMyName()) is a very simple function. It only writes a static string.To
add more functionality to a function, we can add parameters. A parameter is just like a
variable.You may have noticed the parentheses after the function name, like: writeMyName().
The parameters are specified inside the parentheses.
Example 1:The following example will write different first names, but the same last name:
<html>

25

<body>
<?php
functionwriteMyName($fname)
{
echo $fname . " Maan.<br />";
}
echo "My name is ";
writeMyName("anu");
echo "My name is ";
writeMyName("Baby");
echo "My name is ";
writeMyName("Harry");
?>
</body></html>
The output of the code above will be:
My name is anu
My name is Baby.
My name is Harry.
3.3.13 PHP Form Handling
The most important thing to notice when dealing with HTML forms and PHP is that any form
element in an HTML page will automatically be available to your PHP scripts.Form
example:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
The example HTML page above contains two input fields and a submit button. When the user
fills in this form and click on the submit button, the form data is sent to the "welcome.php"
file.The "welcome.php" file looks like this:
<html>

26

<body>
Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
A sample output of the above script may be:
Welcome John.
You are 28 years old.
The PHP $_GET and $_POST variables will be explained in the next chapters.
Form Validation
User input should be validated whenever possible. Client side validation is faster, and will
reduce server load.However, any site that gets enough traffic to worry about server resources,
may also need to worry about site security. You should always use server side validation if the
form accesses a database.A good way to validate a form on the server is to post the form to
itself, instead of jumping to a different page. The user will then get the error messages on the
same page as the form. This makes it easier to discover the error.
The $_GET variable is used to collect values from a form with method="get".
The $_GET Variable
The $_GET variable is an array of variable names and values sent by the HTTP GET
method.The $_GET variable is used to collect values from a form with method="get".
Information sent from a form with the GET method is visible to everyone (it will be displayed
in the browser's address bar) and it has limits on the amount of information to send (max. 100
characters).
Example:
<form action="welcome.php" method="get">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>

27

When the user clicks the "Submit" button, the URL sent could look something like this:The
"welcome.php" file can now use the $_GET variable to catch the form data (notice that the
names of the form fields will automatically be the ID keys in the $_GET array):
Welcome <?php echo $_GET["name"]; ?>.<br />
You are <?php echo $_GET["age"]; ?> years old!
Why use $_GET?
Note: When using the $_GET variable all variable names and values are displayed in the
URL. So this method should not be used when sending passwords or other sensitive
information! However, because the variables are displayed in the URL, it is possible to
bookmark the page. This can be useful in some cases.
Note: The HTTP GET method is not suitable on large variable values; the value cannot
exceed 100 characters.
The $_REQUEST Variable
The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and
$_COOKIE.The PHP $_REQUEST variable can be used to get the result from form data sent
with both the GET and POST methods.Example:
Welcome <?php echo $_REQUEST["name"]; ?>.<br />
You are <?php echo $_REQUEST["age"]; ?> years old!
The $_POST variable is used to collect values from a form with method="post".
The $_POST Variable
The $_POST variable is an array of variable names and values sent by the HTTP POST
method.The $_POST variable is used to collect values from a form with method="post".
Information sent from a form with the POST method is invisible to others and has no limits
on the amount of information to send.
Example
<form action="welcome.php" method="post">
Enter your name: <input type="text" name="name" />
Enter your age: <input type="text" name="age" />
<input type="submit" />
</form>
When the user clicks the "Submit" button, the URL will not contain any form data, and will
look something like this:The "welcome.php" file can now use the $_POST variable to catch

28

the form data (notice that the names of the form fields will automatically be the ID keys in the
$_POST array):
Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old!
Why use $_POST?

Variables sent with HTTP POST are not shown in the URL

Variables have no length limit

However, because the variables are not displayed in the URL, it is not possible to bookmark
the page.
3.3.14

What is a PHP File?

PHP files can contain text, HTML tags and scripts.

PHP files are returned to the browser as plain HTML.

PHP files have a file extension of ".php",.

3.3.15 Why PHP?

3.4

PHP runs on different platforms (Windows, Linux, Unix, etc.)

PHP is compatible with almost all servers used today (Apache, IIS, etc.)

PHP is FREE to download from the official PHP resource: www.php.net

PHP is easy to learn and runs efficiently on the server side


MySQL (Database)

29

3.5.1 What is MySQL?

MySQL is a database server.


MySQL is ideal for both small and large applications.
MySQL compiles on a number of platforms .
MySQL is free to download and use .

3.5.2 ADVANTAGE OF MYSQL


MySQL is a popular database with Web developers. Its speed and small size make it
ideal for a Web site. Add to that the fact that its open source, which means free, and
wehave the foundation of its popularity. Here is a rundown of some of its advantages:

It is fast: The main goal of the folks who developed MySQL was speed.Thus, the

software was designed from the beginning with speed in mind.


It isinexpensive: MySQL is free under the open source GPL license, and the fee for a

commercial license is reasonable.


It iseasy to use: WE can build and interact with a MySQL database by using a few
simple statements in the SQL language, which is the standard language for
communicating with RDBMSs. Check out for the lowdown on the SQL language.

3.5.3 PHP + MySQL

PHP combined with MySQL are cross-platform (you can develop in Windows and
serve on a Unix platform)

3.6 INTRODUCTION TO PHP MY ADMIN

30

phpMyAdmin is a free and open source tool written in PHP intended to handle the
administration of MySQL with the use of a Web browser. It can perform various tasks such as
creating, modifying or deleting databases, tables, fields or rows; executing SQL statements;
managing users and permissions.
History

Tobias Ratschiller, then an IT consultant and later founder of the software company
Maguma, started to work on a PHP-based web front-end to MySQL in 1998, inspired
by MySQL-Web admin. He gave up the project (and phpAdsNew, of which he was
also the original author) in 2000 because of lack of time. By that time, phpMyAdmin
had already become one of the most popular PHP applications and MySQL
administration tools, with a large community of users and contributors. In order to
coordinate the growing number of patches, a group of three developers registered
ThephpMyAdmin Project at SourceForge.net and took over the development in 2001.

Features
Features provided by the program include:
1

Web interface

MySQL database management

Import data from CSV and SQL

Export data to various formats: CSV, SQL, XML, PDF (via the TCPDF library),
ISO/IEC 26300 Open Document Text and Spreadsheet, Word, Excel, Latex and
others

Administering multiple servers

Creating PDF graphics of the database layout

Creating complex queries using Query-by-example (QBE)

Searching globally in a database or a subset of it

Transforming stored data into any format using a set of predefined functions, like
displaying BLOB-data as image or download-link
Active query monitor (Processes)

31

CHAPTER - 4

RESULT ANDDISCUSSIONS
4.1 HOME PAGE

32

4.2 REGISTRATION

33

4.3 Main Page

34

4.4 CONTACT US

35

4.5 MOBILE ADS

36

CHAPTER - 5
CONCLUSION AND FUTURE SCOPE
CONCLUSION
Using secondhand product systems effectively within an organization ensures that
data and knowledge is safe, accurate, and accessible. With that comfort, employees
feel more apt to reduce paper and rely on the secondhand product system.

FUTURE SCOPE

Use new technology


Online
More User Friendly
Modifications in database
Modifications according to feedbacks
More Robust
Add Multimedia in this project

37

REFRENCE
www.w3schools.com
www.wikipedia.com
www.webinfo.com

38

Vous aimerez peut-être aussi