Mailing System Project Report (PHP)
Mailing System Project Report (PHP)
Mailing System Project Report (PHP)
INTRODUCTION
1.1
Purpose
MAILBOX SITE. This system will help the users to know automatically make
account once they have registered with the website. It will also help the users to
know the latest mails of their interests.
1.2 Scope
ABOUT MAILBOX
The portals purpose is to connect businesses seeking mailing and marketing
service providers with those providers who match their needs. The portal also is an
online directory of service providers based on their core competencies, abilities,
and location. Mymail Connection gives higher visibility to service providers than a
generic online search would produce, and connects providers to businesses across
the
world.
Our aim is to deliver your mail to you as efficiently as possible on every occasion.
If something goes wrong with your e-mail account, or you have difficulty
accessing any of our services, please contact us as soon as possible. Mymail is
usually the best.
HTML:
HYPER TEXT MARKUP LANGUAGE:
Is a standard language for making web pages.
HTTP
Hypertext Transfer Protocol:
Its a service protocol.
CSS
CASCADING STYLESSHEET:
Is the latest and used for designing the styling positions of WebPages.
MYSQL
In today's connected world, data and the systems that manage that data must
always be secure yet available to our users. With MySQL, users and information
technology (IT) professionals across your organization will benefit from reduced
application downtime, increased scalability and performance, and tight yet flexible
security controls. MySQL also includes many new and improved capabilities to
help make your IT staff more productive.
In our site MYSQL plays a vital role in sending, receiving, saving mails.
1.5 References
Wikipedia - www.wikipedia.com
www.techterms.com
www.google.com
www.w3school.com
1.6 Overview
Drawbacks:
No webcam support
People who doesnt have a knowledge of computer and internet cannot use the system
Proposed System:
Our Plan:
CHAPTER 2
SYSTEM STUDY
Client on Internet
Web Browser, Operating System(any)
Web Server
WAMP
RAM
64 MB (or above).
HDD
10 GB (or Above).
SERVER SIDE:
Processor
: Pentium-1
(or above).
RAM
HDD
: 20 GB (or Above).
2.5. Constraints
The information of all the users must be stored in a database that is accessible
by the Administrator
It is connected to the computer and is running all 24 hours a day.
The users can access the site from any computer that has Internet browsing
capabilities and an Internet connect.
CHAPTER 3
SPECIFIC REQUIREMENT
Security Requirements
All users should be properly authenticated before allowed entry into the system
authentication will be based on an E-mail address, and a password. All activities on
the system must be logged.
Non-Functional Requirements
o Secure access of confidential data (users details). SSL can be used.
24 X 7 availability.
Better component design to get better performance at peak time.
Flexible service based architecture will be highly desirable for future
extension.
Other Requirements
The user must be agreed with all the term and conditions that have provided by the
System Administrator, local authority and Should Obey to the all International
standards and Protocols.
CHAPTER 4
PROGRAM STRUCTURE AND CODING
The report should give various lists for ex. Name of variables types used in the
program, Data structure, no of modules, pseudo codes, parameter passing
mechanism, files, library uses etc. and also brief explanation of source code and
project scheduling. Basically, mostly ASP six objects are used for programming and
variant types of variables are used in web page application. Let's see the coding
structure of files.
Purpose
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Startup file
To register
Header of the site
Footer of the site
To connect from database
To check your account
To logout from Account
To Compose mail
To check the sent mail
To check the draft
To Read the draft
Index.php
Register.php
Header.php
Footer.php
Connect.php
Account.php
Logout.php
Compose.php
Sent.php
Draft.php
Read_draft.php
Functions.php
Read_mail.php
Delete.php
4.1 Index.php:
<?php
if(isset($_POST['login']))
{
$u_name=$_POST['u_name'];
$pass=$_POST['pass'];
if(isset($_POST['cookie']))
{$cookie=$_POST['cookie'];}
include('connect.php');
$query="select u_name,password,first_name,last_name from user_data where
u_name='$u_name' and password='$pass'";
$res=mysql_query($query) or die(mysql_error());
$result= mysql_num_rows($res);
$row=mysql_fetch_assoc($res);
if($result != 0)
{
if($cookie=="yes")
{
setcookie("user","$u_name",time()+60*3);
setcookie("pass","$pass",time()+60*3);
setcookie("auth",1,time()+60*3);
setcookie("f_name",$row['first_name'],time()+60*3);
setcookie("l_name",$row['last_name'],time()+60*3);
header("location:account.php");
}
else
{
session_start();
$_SESSION['user']=$u_name;
$_SESSION['pass']=$pass;
$_SESSION['auth']=1;
$_SESSION['f_name']=$row['first_name'];
$_SESSION['l_name']=$row['last_name'];
header("location:account.php");
}
}
else
{
$invalid="<font color=red><center>User name or Password is
wrong....</center></font>";
}
?>
4.2 Register.php
<?php
if(isset($_POST['register']))
{
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$uname=$_POST['uname'];
$pass=$_POST['pass'];
$cfpass=$_POST['cfpass'];
$bd_date=$_POST['bd_date'];
$bd_month=$_POST['bd_month'];
$bd_year=$_POST['bd_year'];
$gender=$_POST['gender'];
$mobno=$_POST['mobile'];
$country=$_POST['country'];
/*echo $fname."<br>";
echo $lname."<br>";
echo $uname."<br>";
echo $pass."<br>";
echo $cfpass."<br>";
echo $bd_date."<br>";
echo $bd_month."<br>";
echo $bd_year."<br>";
echo $gender."<br>";
echo $mobno."<br>";
echo $country."<br>";*/
if(($pass==$cfpass) && ($bd_date > 0 && $bd_date < 32) && ( $bd_month != -1
&& $bd_year != -1))
{
include('connect.php');
$query= "insert into user_data values('','$fname','$lname','$uname','$pass',
$bd_date,'$bd_month',$bd_year,'$gender',$mobno,'$country')";
//$query= "insert into user_data
values('','rakesh','Bhatt','raj123','123456',12,'January',2012,'male',8487490300,'Austria')";
mysql_query($query) or die('could not insert data');
}
else
{
echo "Something went wrong in password or birthdate.<br>Please go back and
fill proper data...";
die();
}
}
?>
4.3 Header.php
<div id="header_bar">
<div class="content">
<img class="logo" src="images/logo.jpg" alt="google"></img>
<span class="sign_out">
<a href="logout.php">LOG OUT</a></span>
</div>
</div>
4.4 Footer.php
<div class="footer-bar">
<div class="footer content clearfix" align="center">
<ul>
<li><b><font size="+1"> mailBOX.com
2013</font></b></li>
</ul>
</div>
</div>
4.5 Connect.php
<?php
mysql_connect("localhost","root","") or die('could not connect to database');
mysql_select_db("gmail") or die('could not select database');
?>
4.6 Account.php
<?php
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
elseif(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
//echo "<a href='logout.php'>Logout</a>";
}
else
{
}
$mail_glue= rand(10000,99999);
$_SESSION['mail_glue']=$mail_glue;
$_SESSION['inbox']= 1;
unset($_SESSION['sent_box']);
unset($_SESSION['draft']);
//echo $_SESSION['mail_glue'];
//print_r($_SESSION);
?>
4.7 Logout.php
<?php
session_start();
session_destroy();
setcookie("auth","",time()-60);
header("location:index.php");
?>
4.8 Compose.php
<?php
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
else if(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
//echo "<a href='logout.php'>Logout</a>";
}
else
{
if(isset($_POST["send-mail"]))
{
include("connect.php");
$to=$_POST["to"];
$from=$_POST["from"];
$subject=$_POST["subject"];
$message=$_POST["message"];
$query="insert into mails(sender,receiver,subject,message,flag)
values('$from','$to','$subject','$message','')";
mysql_query($query);
$_SESSION['note']="sn";
header("location:sent.php");
if(isset($_POST['draft']))
{
include("connect.php");
$to=$_POST["to"];
$from=$_POST["from"];
$subject=$_POST["subject"];
$message=$_POST["message"];
$query="insert into mails(sender,receiver,subject,message,flag)
values('$from','$to','$subject','$message','draft')";
mysql_query($query);
$_SESSION['note']="dr";
header("location:account.php");//use draft.php instead
*******CORRECTED********
?>
4.9 Sent.php
<?php
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
elseif(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
//echo "<a href='logout.php'>Logout</a>";
}
else
{
//echo $_SESSION['mail_glue'];
$_SESSION['sent_box']= 1;// for checking the source of the incoming mail id for
delete
unset($_SESSION['inbox']);
unset($_SESSION['draft']);
//print_r($_SESSION);
?>
4.10
Draft.php
<?php
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
elseif(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
//echo "<a href='logout.php'>Logout</a>";
}
else
{
}
$_SESSION['draft']= 1;
unset($_SESSION['sent_box']);
unset($_SESSION['inbox']);
?>
4.11
Read_Draft.php
<?php
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
else if(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
//echo "<a href='logout.php'>Logout</a>";
}
else
{
if(isset($_POST['send-mail']))
{
include("connect.php");
$m_id=$_POST['del_id'];
$to=$_POST['to'];
$from=$_POST['from'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$query="update mails set flag='' where id=$m_id";
mysql_query($query);
$_SESSION['note']='sn';
header("location:sent.php");
}
/*if(isset($_POST['draft']))
{
include("connect.php");
$to=$_POST['to'];
$from=$_POST['from'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$query="insert into mails(sender,receiver,subject,message,flag)
values('$from','$to','$subject','$message','draft')";
mysql_query($query) or die(mysql_error());
mysql_close();
}*/
if(isset($_POST['delete']))
{
include("connect.php");
$m_id=$_POST['del_id']-$_SESSION['mail_glue'];
$query="delete from mails where id=$m_id";
mysql_query($query);
$_SESSION['note']= 1;
header("location:draft.php");
}
if(isset($_GET['mail_id']))
{
$m_id=$_GET['mail_id'];
$_SESSION['mail_id']=$m_id;
header("location:read_draft.php");
}
if(isset($_SESSION['mail_id']))
{
$m_id= $_SESSION['mail_id'] - $_SESSION['mail_glue'];
include("connect.php");
$query="select * from mails where id=$m_id";
$result=mysql_query($query);
while($row=mysql_fetch_assoc($result))
{
$show_to=$row['receiver'];
$show_subject=$row['subject'];
$show_message=$row['message'];
}
}
?>
4.12
Funtions.php
<?php
$word_array=explode(" ",$string,$size);
$new_word=implode(" ",$word_arry);
return($new_word);
}
?>
4.13
Read_mail.php
<?php
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
elseif(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
}
else
{
if(isset($_GET['mail_id']))
{
$m_id=$_GET['mail_id'];
$_SESSION['mail_id']=$m_id;
header("location:read_mail.php");
}
if(isset($_SESSION['mail_id']))
{
$mail_id= $_SESSION['mail_id'] - $_SESSION['mail_glue'];
}
//anyone can read mail who is register of any other persone add securty for this
*********not completely but some how fixed*********
//print_r($_SESSION);
?>
4.14
Delete.php
<?
session_start();
if(isset($_SESSION['auth']))
{
$f_name=$_SESSION['f_name'];
$l_name=$_SESSION['l_name'];
//echo "hello! ".$f_name." you are logged in via session";
//echo "<a href='logout.php'>Logout</a>";
}
elseif(isset($_COOKIE['auth']))
{
$f_name=$_COOKIE['f_name'];
$l_name=$_COOKIE['l_name'];
//echo "hellow ".$_COOKIE['user']."you are logged in via cookie";
//echo "<a href='logout.php'>Logout</a>";
}
else
{
if(isset($_POST['del_mail']))
{
include("connect.php");
$m_id=$_POST['del_id']- $_SESSION['mail_glue'];
$query="delete from mails where id=$m_id";
mysql_query($query);
//add identification for the mail whether it is sent or recieved from the account holder
and forward to the respective page
}
$_SESSION['note']="dl";
//print_r($_SESSION);
CHAPTER 5
SYSTEM ANALYSIS
5. Analysis and Design: This section should be included and depicted clearly in the project file such as flow
charts, Data flow Diagrams, Use of Decision table, Structural Analysis, ER Diagram
etc. This chapter deals with techniques applied in information system analysis, data
modeling and normalization. This chapter shows a process of providing full specification
of systems to users to help them consider and accept. This specification is also a
major information source for designers of the new system. It not only specifies the
system's objectives but also describes the work and its constraints to which designers
have to comply.
During system analysis and design, several tools, techniques and models are
used to record and analyze the current system and new requirements of
users, and define a format for the future system;
Structural analysis when put together with the prototype method can help
users and analysts have an idea of the new system and help make best use of
both methods.
CHAPTER 6
SYSTEM DESIGN SPECIFICATION
6. System Design:
This chapter introduces techniques for the design of interfaces, menus, and databases, based
on the requirement specification worked out during the analysis phase (functioning diagram,
relationship diagram, data flow diagram...). At the end of this phase, you need to identify the
borderline between the computer system and human being and find the answer to the question
of how to attain the system's objectives.
The design of an appropriate information system requires that analysts understand the goals
and objectives of management. They must also be sensitive to changes that may occur to
these goals and objectives over tim e in response to shifts in the competitive environment.
6.1.
6.1.1.
Input Design
Registration of client
This section register client information and register mail ID for specific domain.
6.1.2.
Login Board
Basically, For security purpose to view mails we should login site and can see our
personal mails only.
6.1.3.
Mail list
Mail list show the list of mail in box that are sent by others.
6.1.4.
Compose mail
This section contain about composing mail and sending only.
6.2.
Output Design
A number of basic design principles ensure that the output is presented in a way that is
easy to understand and interpret. Notes, headings, and output formats should be
standardized whenever possible. Format consistency is an attribute of user-friendly
output. Users feel comfortable. With familiar layouts. Acronyms and abbreviations in
output should be avoided especially when the output will serve novice users. Define
words that may be unfamiliar to the user. Algorithms and assumptions on which
calculations are based should be available to users of the output. This assures correct
interpretation of output.
6.3.
Database Design
A specialized set of programs, called a Data Base Management System (DBMS)
is generally acquired to help computer users access and manipulate the data in a
data base system. Most DBMSs include a special query language that allow
users to access the data base.
Retrieve information from data base without having to write a program. Data can be added,
retrieved, updated, and deleted from data base using DBMS functions. If writing an
application program for a transactional system n batch, the programmer accesses and uses
the data base by writing the program in a record-level language provided by the DBMS,
which is called the host language. An important function provided by a DBMS is data
independence. Data independence means that users and programmers are insulated from
database. They do not know how the physical database is stored. Since all access to data
is made via the DBMS, data base management systems can perform another important
function- da ta access protection. For example, the DBMS might be programmed to refer
to an internal security matrix to determine which data elements a particular user is
permitted to access and what type of operations that users can perform- read only, write
only, or read, write and delete.
6.5.2.Pseudocode:
Pseudocode can be used to describe an algorithm. Although pseudocode resembles
structured English (SE) in using a restricted subset of English, it may be coded and more
closely resemble a programming language.
6.6.Structure Chart
6.7.Transaction Analysis
6.8.Specific Data Abstraction, Information Hiding
6.9. System Flow
6.9.1.
Home page
Purpose
Purpose
Sample screen
6.9.2.Registration
client
Purpose
Sample Screen
6.9.3.
Login
6.9.4.Check mail
Purpose
Sample Screen
6.9.5.Compose mail
Purpose
Sample Screen
32
CHAPTER 7
SECURITY
CHAPTER 8
CONCLUSION
Using all of the described tools, PHP Security provides a secure
environment in which users and Web Services communicate and
interact.
The ultimate goal of the project is to achieve the mailing service to all
individual users.
34