0% found this document useful (0 votes)
22 views63 pages

SNS Documentation

The document describes the development of a social networking website. The purpose is to build a website that allows users to create profiles, share posts and media, add friends, and send messages. It will reduce manual work by managing user accounts, posts, shares, and other modules from the admin panel. Key features include user registration and login, profile editing, photo/video sharing, liking/commenting on posts, friend requests, and chat functionality.

Uploaded by

ksneha kannan
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)
22 views63 pages

SNS Documentation

The document describes the development of a social networking website. The purpose is to build a website that allows users to create profiles, share posts and media, add friends, and send messages. It will reduce manual work by managing user accounts, posts, shares, and other modules from the admin panel. Key features include user registration and login, profile editing, photo/video sharing, liking/commenting on posts, friend requests, and chat functionality.

Uploaded by

ksneha kannan
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/ 63

1.

SYNOPSIS

“SOCIAL NETWORKING SITE” is the place where persons after creating their
account can share their ideas on various topics. This project aims to develop a website for
people to communicate. People who wants to share their ideas and give their views for creating
social awareness can use this application. In this project user to create profile, share the information
with friends. They can create the growing network information. Users once Registered can establish
their , views about social responsibilities and made publically as well. This project provides ideas of
developing the application called as social networking sites.

1
PROJECT PROFILE
The purpose of the project is to build an Website to reduce the manual work for
managing the Users, Videos, Posts, Shares. Site takes care of different modules. They are:

❑ ADMIN MODULE

❑ USER MODULE

❑ POST MODULE

❑ FRIEND MODULE

❑ GALLERY MODULE

❑ CHAT MODULE

2
2.1.MODULE DESCRIPTION

1.ADMIN MODULE:

• LOGIN: Admin can login in his personal account using id and password.

• VIEW: Admin can view all information about the user.

• BLOCK : Admin can block the reported account

2.USER MODULE:

• LOGIN: User can login their personal account using username and
password.
• EDIT PROFILE: The users can edit their profile.

3.POST:

• UPLOAD : User can upload their photos , videos.

• SHARE : User can share their thoughts to others using share


button.

• LIKE & COMMENT : User can like the post and share their
thoughts via comments.

4.FRIENDS :

• ADD FRIENDS : User can add their friends.

• REQUEST : User can send friend request to others.

5.GALLERY :

• SAVE : User can save the pictures and videos as their like.

6.CHAT :

• SEND & RECEIVE MESSAGE : User can send and receive


messages to others.
• DELETE : User can delete their messages.

3
ADVANTAGES:

• This Site fully works as an offline.


• Centralized maintain all information.
• It helps the people to communicate .
• People who wants to share their ideas and give their views for creating social
awareness can use this application
• This system is user friendly.

LIMITATIONS :

• Data need to be entered properly otherwise, outcome may won’t be accurate.

4
3.SYSTEM ANALYSIS

3.1 EXISTING SYSTEM :

➢ In general people share their ideas and knowledge from their colleagues or friends
through the intercom or direct manner. They need to spend time for their work.
➢ Some of the drawbacks are:

1. It consumes more time.

2. It is not user-friendly.

3.2 PROPOSED SYSTEM

➢ It is difficult to note down all the problems manually. Instead it is decided to


develop an “SOCIAL NETWORKING SITE” to ease the operation.
➢ A system is required which is being capable of elimination all the problems and
become useful to users and thus the new system is derived.
➢ Here we get a different view from different users.

BENEFITS:

➢ Users articles can be viewed by others

➢ Less time consuming

5
4.SYSTEM REQUIREMENTS

4.1 SOFTWARE SPECIFICATION :


Operating System : Windows OS 2010
Client_Side Language : HTML
Programming Language : PYTHON
Framework : FLASK
Ide/Workbench : WAMP
Database : MYSQL

4.2 HARDWARE SPECIFICATION :


Processor : AMD PRO A4-3350B APU With Redeon R4 Graphics
Hard Disk : 250MB
RAM : 2GB
System Type : 32_Bit Operating System
Mouse : Logitech
Keyboard : 110 keys enhanced

6
4.3 SOFTWARE DESCRIPTION

PROJECT DESCRIPTION:

Python is a general-purpose interpreted, interactive, object-oriented, and high-level


programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl,
Python source code is also available under the GNU General Public License (GPL).

SOFTWARE AND HARDWARE REQUIREMENTS

This section describes the software and hardware requirements of the system.

HTML Introduction

HTML, an acronym for HyperText Markup Language, is a primary markup language for
creating websites. It consists of a series of codes used to structure texts, images, and other
content to be displayed in a browser

Basic HTML Concepts

Elements, tags, and attributes are basic concepts in HTML:

HTML element is a main structural unit of a web page. HTML tags are used to
define HTML elements, and attributes provide additional information about these elements.

HTML Tags:

HTML tags are used to structure website content (text, hyperlinks, images, media,
etc). Tags are not displayed in the browsers, they only “instruct” browsers how to show the
content of the web page.

There are over 100 tags in HTML, and we can find them in our HTML tutorial.
HTML tags are written in angle brackets (e.g <html>).

Most of HTML tags comes in pairs, like <p> </p> tags. The first tag in a pair called
the start (opening) tag, and the second tag is the end (closing) tag. The information is
written between opening and closing tags.

However, there are unpaired, or empty tags, which only have opening tag. (for ex.

<img/>).

Let’s consider an example.

7
If we need to define a paragraph (which is an element ) we should use <p> tag. The content
of the paragraph we should write between opening (<p>) and closing (</p>) tags.

Example

This is a paragraph between opening <p> and closing </p> tags.

HTML ATTRIBUTES

HTML attributes are added to an HTML element to provide additional information


about it. For example, if we define an image with <img/> tag, we can use src, height, width
attributes to provide information about its source, height, width correspondingly.

STRUCTURE OF AN HTML DOCUMENT :

The <!DOCTYPE html> declaration specifies the HTML version used in the
document. Every HTML document should start with this declaration so that the browsers
can render the page compliant with HTML standards.

There exist several types of <!DOCTYPE> defined for each HTML version.

All the content on the webpage is written between <html> </html> tags. The <html>
element is used to give information to the browsers that it is an HTML document.

The <head> element contains metadata (data about the HTML document), character
set, document title, styles, etc. This data is not shown to viewers.

The <title> displays the title of the website in the browser tab when the page is
loaded. The title is written between <title> </title> tags.

The <body> element contains the content of the webpage (text, images, videos, etc).

The content is written between <body> </body>.

Heading elements contain different types of headings. There are six heading levels -

<h1>-<h6>, where <h1> is the most important and <h6> least important tags.

The <p> element contains paragraphs of the text. The content is written between
<p> and </p> tags.

CSS ;

Cascading Style Sheets, fondly referred to as CSS, is a simple design language


intended to simplify the process of making web pages presentable.

8
CSS handles the look and feel part of a web page. Using CSS, we can control the
color of the text, the style of fonts, the spacing between paragraphs, how columns are sized
and laid out, what background images or colors are used, lawet designs,variations in display
for different devices and screen sizes as well as a variety of other effects.

CSS is easy to learn and understand but it provides powerful control over the
presentation of an HTML document. Most commonly, CSS is combined with the markup
languages HTML or XHTML.

ADVANTAGES OF CSS ;

➢ CSS saves time − We can write CSS once and then reuse same sheet in multiple
HTML pages. We can define a style for each HTML element and apply it to as many
Web pages as we want.
➢ Pages load faster − If we are using CSS, we do not need to write HTML tag
attributes every time. Just write one CSS rule of a tag and apply it to all the
occurrences of that tag. So less code means faster download times.
➢ Easy maintenance − To make a global change, simply change the style, and all
elements in all the web pages will be updated automatically.
➢ Superior styles to HTML − CSS has a much wider array of attributes than HTML,
so we can give a far better look to wer HTML page in comparison to HTML
attributes.
➢ Multiple Device Compatibility − Style sheets allow content to be optimized for
more than one type of device. By using the same HTML document, different
versions of a website can be presented for handheld devices such as PDAs and cell
phones or for printing.
➢ Global web standards − Now HTML attributes are being deprecated and it is being
recommended to use CSS. So its a good idea to start using CSS in all the HTML
pages to make them compatible to future browsers.

PYTHON:

Python is a widely-used, interpreted, object-oriented, and high-level programming


language with dynamic semantics, used for general-purpose programming. It was created by
Guido van Rossum, and first released on February 20, 1991.

Python is a powerful general-purpose programming language. It is used to develop


web applications, data science, creating software prototypes and so on. Fortunately for

9
beginners, Python has simple easy-to-use syntax. This makes Python an excellent language
to learn to program for beginners.

FEATURES OF PYTHON PROGRAMMING LANGUAGE READABLE: PYTHON


IS A VERY READABLE LANGUAGE.

EASY TO LEARN: Learning python is easy as this is a expressive and high level
programming language, which means it is easy to understand the language and thus easy to
learn.

CROSS PLATFORM: Python is available and can run on various operating systems such
as Mac, Windows, Linux, Unix etc. This makes it a cross platform and portable language.

OPEN SOURCE: Python is a open source programming language.

LARGE STANDARD LIBRARY: Python comes with a large standard library that has
some handy codes and functions which we can use while writing code in Python.

FREE: Python is free to download and use. This means we can download it for free and use
it in were application.Python is an example of a FLOSS (Free/Libre Open Source Software),
which means we can freely distribute copies of this software, read its source code and
modify it.

SUPPORTS EXCEPTION HANDLING: If we are new, we may wonder what is an


exception? An exception is an event that can occur during program exception and can
disrupt the normal flow of program. Python supports exception handling which means we
can write less error prone code and can test various scenarios that can cause an exception
later on.

ADVANCED FEATURES: Supports generators and list comprehensions.

AUTOMATIC MEMORY MANAGEMENT: Python supports automatic memory


management which means the memory is cleared and freed automatically. We do not have
to bother clearing the memory.

APPLICATIONS OF PYTHON

WEB DEVELOPMENT – Web framework like Django and Flask are based on Python.
They help we write server side code which helps we manage database, write backend
programming logic, mapping urls etc.

10
MACHINE LEARNING – There are many machine learning applications written in
Python. Machine learning is a way to write a logic so that a machine can learn and solve a
particular problem on its own. For example, products recommendation in websites like
Amazon, Flipkart, eBay etc. is a machine learning algorithm that recognises user’s interest.
Face recognition and Voice recognition in wer phone is another example of machine
learning.

DATA ANALYSIS – Data analysis and data visualisation in form of charts can also be
developed using Python.

SCRIPTING – Scripting is writing small programs to automate simple tasks such as


sending automated response emails etc. Such type of applications can also be written in
Python programming language.

GAME DEVELOPMENT – We can develop games using Python. We can develop


Embedded applications in Python.

DESKTOP APPLICATIONS – We can develop desktop application in Python using


library like TKinter or QT.

FLASK :

Flask is a web framework. This means flask provides we with tools, libraries and
technologies that allow we to build a web application. This web application can be some
web pages, a blog, a wiki or go as big as a web-based calendar application or a commercial
website.

Flask is part of the categories of the micro-framework. Micro-framework are


normally framework with little to no dependencies to external libraries. This has pros and
cons. Pros would be that the framework is light, there are little dependency to update and
watch for security bugs, cons is that some time we will have to do more work by werself or
increase werself the list of dependencies by adding plugins. In the case of Flask, its
dependencies are:

❖ Werkzeug a WSGI utility library


❖ jinja2 which is its template engine

A web framework is an architecture containing tools, libraries, and functionalities


suitable to build and maintain massive web projects using a fast and efficient approach.
They are designed to streamline programs and promote code reuse. To create the server-side
of the web application, we need to use a server-side language. Python is home to numerous

11
such frameworks, famous among which are Django and Flask.Python Flask Framework is a
lightweight micro-framework based on Werkzeug, Jinja2. It is called a micro framework
because it aims to keep its core functionality small yet typically extensible to cover an array
of small and large applications. Flask Framework depends on two external libraries: The
Jinja2 template, Werkzeug WSGI toolkit. Even though we have a plethora of web-apps at
our disposal, Flask tends to be better suited due to –

➢ Built-in development server, fast debugger.


➢ Integrated support for unit testing.
➢ RESTful request dispatching.
➢ Jinja2 Templating.
➢ Support for secure cookies.
➢ Lightweight and modular design allows for a flexible framework.

CRITICAL ELEMENTS OF PYTHON FLASK FRAMEWORK

INITIALIZATION: Flask applications must create an application instance. The web server
passes all the requests it receives from clients to objects for handling using a protocol for
WSG from flask import Flask app = Flask ( name ) (The application instance is an object
of class Flask.)

➢ App root Init – (project_root/app_name/ init .py) – Not necessary to define


the entire app within init .py
➢ Module Init – (project_root/app_name/admin/ init .py) – required to
enable the app
➢ Module URL – (project_root/app_name/admin/url.py) – Url definitions of
each module
➢ Module Views – (project_root/app_ame/admin/views.py) – Defines views
for each module. Separate ‘.py.’ Files as the project scale to ensure they are
accessible to URLs.
➢ ModuleTemplates:(project_root/app_name/admin/templates/admin/main.ht
ml) – Normal template folder.

ROUTES AND VIEW FUNCTIONS IN FLASK FRAMEWORK


INSTANCE ;

Clients send requests to the webserver, in turn, sends them to the Flask application
instance.

12
The instance needs to know what code needs to run for each URL requested, keeps a
mapping of URLs to Python functions.

The association between a URL and the function that handles it is called a route,
most convenient way to define a route in a Flask application is through the (app.route).

Decorator exposed by the application instance, which registers the ‘decorated function,’
decorators are python feature that modifies the behavior of a function. @app.route('/')

def index():

return 'Xenonstack'

The index is a view function, and the response can even be a string format HTML.

SERVER STARTUP – The application instance has a ‘run’ method that launches flask’s
integrated development web server –

if name == ' main ':

app.run(debug=True)

Once the script starts, it waits for requests and services in a loop.

Local-Host – Run a python script in a virtual environment. Flask starts the server listening
on and port 5000 by default. To accept connection from any remote address, use host =
‘0.0.0.0.’

HTTP METHODS

Request – To process incoming data in Flask, we need to use the request object, which
includes mime-type, IP address, and data. HEAD: Un-encrypted data sent to server w/o
response.

GET – sends data to the server requesting a response body.

POST – Read form inputs and register a user, send HTML data to the server are methods
handled by the route.

Flask attaches methods to each route so that different view functions can handle different
request methods to the same URL.

Response – Flask invokes a view function, it has to return a response value to the client.
HTTP requires it to be more than a string response, a status code

➢ Informational – 1xx

13
➢ Successful – 2xx
➢ Redirection – 3xx
➢ Client Error – 4xx
➢ Server Error – 5xx

Templates – To maintain the site. Flask uses a powerful template engine ‘Jinja2’, in its
simplest form, a Jinja2 template is a file that contains the text of a response, returned by a
view function that has a dynamic component represented by a variable.

Linking – Dynamic url routing support is included using ‘url_for()’ helper function. For
example, url_for('sagar', name='project_file', _external=True) would return
http://localhost:5000/sagar/project_file.

Security – CSRF(Cross-Site-Request-Forgery) occurs when a malicious website sends


requests to a different website on which the victim is logged in. Flask-WTF protects against
all such attacks. Apart from that, Flask also implements some common security mechanisms
like session-based management, role mgmt, password hashing, basic HTTP and token-based
authentication, optional log in tracking.

DATABASE MANAGEMENT SYSTEM & TYPES OF DBMS

A Database Management System (DBMS) is a software application that interacts with the
user, applications and the database itself to capture and analyze data. The data stored in the
database can be modified, retrieved and deleted, and can be of any type like strings,
numbers, images etc.

TYPES OF DBMS

There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and
Object- Oriented DBMS.

Hierarchical DBMS: As the name suggests, this type of DBMS has a style of predecessor-
successor type of relationship. So, it has a structure similar to that of a tree, wherein the
nodes represent records and the branches of the tree represent fields.

Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to
identify and access data in relation to another piece of data in the database.

Network DBMS: This type of DBMS supports many to many relations wherein multiple
member records can be linked.

14
Object-oriented DBMS: This type of DBMS uses small individual software called objects.
Each object contains a piece of data, and the instructions for the actions to be done with the
data.

MySQL

It is one of the most popular database management systems originally launched way
back in 1995. SQL is the core of MySQL. And ‘My’ with ‘SQL’ is there because it’s the
name of its co-founder Michael Widenius’ daughter. It is an open-source relational database
management system.

MySQL is a freely available database system. However, there are several paid
editions also available with which we can use advanced functionality. MySQL is easy to use
as compared to other database software such as Microsoft SQL Server and Oracle database
etc. It can be used with any programming language

Features of MySQL

Ease of Management – The software very easily gets downloaded and also uses an event
scheduler to schedule the tasks automatically.

Robust Transactional Support – Holds the ACID (Atomicity, Consistency, Isolation,


Durability) property, and also allows distributed multi-version support.

Comprehensive Application Development – MySQL has plugin libraries to embed the


database into any application. It also supports stored procedures, triggers, functions, views
and many more for application development.

High Performance – Provides fast load utilities with distinct memory caches and table
index partitioning.

Low Total Cost Of Ownership – This reduces licensing costs and hardware expenditures.

Open Source & 24 * 7 Support – This RDBMS can be used on any platform and offers
24*7 support for open source and enterprise edition.

Secure Data Protection – MySQL supports powerful mechanisms to ensure that only
authorized users have access to the databases.

High Availability – MySQL can run high-speed master/slave replication configurations and
it offers cluster servers.

MySQL Data Types

15
Numeric – This data type includes integers of various sizes, floating-point(real) of various
precisions and formatted numbers.

Character-string – These data types either have a fixed, or a varying number of characters.
This data type also has a variable-length string called CHARACTER LARGE OBJECT
(CLOB) which is used to specify columns that have large text values.

Scalability & Flexibility – With MySQL we can run deeply embedded applications and
create data warehouses holding a humongous amount of data.

Timestamp & Interval – The TIMESTAMP data type includes a minimum of six
positions, for decimal fractions of seconds and an optional WITH TIME ZONE qualifier in
addition to the DATE and TIME fields. The INTERVAL data type mentions a relative value
that can be used to increment or decrement an absolute value of a date, time, or timestamp.

Bit-string – These data types are either of a fixed length or varying length of bits. There is
also a variable-length bit string data type called BINARY LARGE OBJECT(BLOB), which
is available to specify columns that have large binary values, such as images.

Boolean – This data type has TRUE or FALSE values. Since SQL, has NULL values, a
three-valued logic is used, which is UNKNOWN.

Date & Time – The DATE data type has: YEAR, MONTH, and DAY in the form YYYY-
MM-DD. Similarly, the TIME data type has the components HOUR, MINUTE, and
SECOND in the form HH:MM: SS. These formats can change based on the requirement

16
5.SYSTEM DESIGN

5.1. STRUCTURE DESIGN :.

Social Networking
Sites

ADMIN USER POST FRIENDS GALLERY CHAT

Register Upload post Add Friends Save Images Send


View user and videos messages
details

Share and Send Request Delete


like post. to Friends Messages

17
5.1.1. DATA DICTIONARY :

TABLE NAME: REGISTRATION

NAME TYPE

FirstName VarChar

Last Name VarChar

UserName VarChar

DOB INTEGER

Gender VarChar

MoblieNumber INTEGER

Email id VarChar

Password VarChar

TABLE NAME: FRIENDS


NAME TYPE

UserName VarChar

Friends name Varchar

TABLE NAME: POST

NAME TYPE

UserName VarChar

Post Varchar

File varchar

Date date

18
TABLE NAME: GALLERY

NAME TYPE

UserName VarChar

Post Varchar

5.2. DATAFLOW DIAGRAM


Dataflow diagram is generated in which the nodesspecify processing activities and
the areas specify data items transmitted between processing nodes. Dataflow diagram are
excellent mechanism for communicating with customers name conventions and name of
system components such as subsystems, files and links.

Rectangle =

Arrow =

Circle =

Open rectangle =

19
ADMIN MODULE:

ADMIN LOGIN VIEW USER


DETAILS

USER MODULE :

LOGIN
USER
HOME

REGISTER

POST MODULE :

UPLOAD
USER POST
POST

20
FRIEND MODULE :

ADD
USER FRIEND
FRIEND

FRIEND PROFILE

CHAT MODULE :

SEND
USER &RECEIVE
MESSAGE CHAT

GALLERY MODULE :

SAVE
IMAGES
USER
INFORMATION AND GALLERY
VIDEOS

21
5.4 DETAILED DESIGN
5.4.1.INPUT DESIGN :
The main objective in output design is to specify how the information is put into a
term that is acceptable to computer. The files and database information, frequency and
certificate requirements are considered in the selection of input format. Another objective is
to ensure that input is acceptable and understandable to user.

Input design is the process of converting user-originated inputs to a computer-based


format. The goal of input is to make data-entry as easy and it shall be free error as possible.
A well-designed input should serve four purposes.

✓ Control work flow.


✓ Controlling errors.
✓ To allow easier checking of data.
✓ Controlling the amount of input.

When data is fed into a system, the operator must receive in that can understood reality. The
operator should key the data in the order in which it occurs on the forum and the computer
should reformat it as required.

5.4.2.OUTPUT DESIGN

The output information must be provided in such a format that the people can
understand. After analysing the operation of the system. In addition to this, these outputs
may be in a format suitable to input for subsequent processing.

Computers output is the most important and direct source of information to the user.
Efficient intelligence output design should improve the system relationship with the user
and help in decision making.

The standards for printed output suggest the following:

➢ Give each output a specific name or title.


➢ Provide a sample of output layout, including areas where printing may
appear and the location of each field.
➢ State whether each output field is to include significant zeros, space
between fields and alphabetic or any other data.
➢ Specify the procedure for providing the accuracy of output data.

22
6. SYSTEM IMPLEMENTATION
The implementation phase of software development is concerned with translating design
specification into source code. The primary goal of implementation is to write source code
and internal documentation so that conformance of the code to its specifications can be
easily verified and so that debugging, testing and modification are eased. This goal can be
achieved by making the source code as clear and straight forward as possible. This stage
consists of

❖ Testing the developed program with sampled data.


❖ Detection and correction of errors.
❖ Testing whether the system meets user requirement.
❖ Creating filters of the system with actual data.
❖ Making necessary changes as desired by the user.
❖ Training user personnel.

It involves careful maintaining, investigation of the current system and its constraints
and implementation, design of methods to achieve the changeover methods. Apart from
maintenance, there are two major tasks of preparing for implementations are education and
training of users and system testing.

The more complex, the system being implemented, the more involved will be the system
analysis and design effort required just for implementation co-coordinating committee
depends on policy at individual organizations. The committee will be sounding board for
ideas, complaints and problems in the user department. The coordination and control require
careful maintenance and the establishment of schedules.

The system has been tested with sample data and adequate corrections were made as per
user requirements. The user has very little chances of making data entry errors since enough
validation checks and validation error message are provided in the system. The end user
with minimum amount of computer knowledge will be able to key in the data and
understand the error messages. All reports have been found to satisfy their requirements.

23
7. SYSTEM TESTING
Testing is the major quality control measure employed during software
development. Its basic function is to be detecting errors in the software. During requirement
analysis and design the output is a document that is textual and non-executed for testing
purpose. This implies that testing not only to recover error introducing during coding but
also error introduced during the previous phases. The goal of testing is to uncover
requirement design or coding error in the program so, different levels of testing are
employed.

UNIT TESTING

The procedure level testing is made first. By giving improper inputs, the errors occurred are
noted and eliminated. Then the web form level testing is made. For example storage of data
to the table in the correct manner.

The dates are entered in wrong manner and checked. Wrong email-id and web site URL
(Universal Resource Locator) is given and checked.

SYSTEM TESTING

These tests are designed to intentionally two kinds of activities, integration testing and
acceptance testing. Strategies for integration software components into a functional product
include the bottom up strategy and top down strategy. Careful planning and scheduling and
required to ensure that the modules will be available for integration strategy decade the
order in which the module must be available and the experts influence on the integration
testing strategized.

INTEGRATION TESTING

Testing is done for each module. After testing all the modules, the modules are integrated
and testing of the final system is done with the test data, specially designed to show that the
system will operate successfully in all its aspects conditions. Thus the system testing is a
confirmation that all is correct and an opportunity to show the user that the system works.

VALIDATION TESTING

The final step involves Validation testing, which determines whether the software function
as the user expected. The end-user rather than the system developer conduct this test most

24
software developers as a process called “Alpha and Beta Testing” to uncover that only the
end user seems able to find.

The compilation of the entire project is based on the full satisfaction of the end
users. In the project, validation testing is made in various forms. In registration form Email
id, phone number and also mandatory fields for the user is verified.

VERIFICATION TESTING

Verification is a fundamental concept in software design. This is the bridge between


customer requirements and an implementation that satisfies those requirements. This is
verifiable if it can be demonstrated that the testing will result in an implementation that
satisfies the customer requirements. Inadequate testing or non-testing leads to errors that
may appear few months later. This will create two problems

✓ Time delay between the cause and appearance of the problem.


✓ The effect of the system errors on files and records within the system.
MAINTENANCE

The objectives of this maintenance work are to make sure that the system gets into
work all time without any bug. Provision must be for environmental changes which may
affect the computer or software system. This is called the maintenance of the system.
Nowadays there is the rapid change in the software world. Due to this rapid change, the
system should be capable of adapting these changes. In our project the process can be added
without affecting other parts of the system. Maintenance plays a vital role. The system
liable to accept any modification after its implementation. This system has been designed to
favour all new changes. Doing this will not affect the system’s performance or its accuracy.

25
8. CONCLUSION

Social media is a really convenient and important communication network for all the people
nowadays. We can use it to know friends and keep contact with friends that came from
different countries. We can also share our ideas so quickly so that all the things could
develop so fast because people could tell us their ideas and we could improve it
immediately.
It also helps in creating a community based on single minded thought who can share their
knowledge. This project is designed to adaptable to new future enhancements made with it
maintaining same efficiency.

26
8.1. APPENDIX-A SAMPLE SCREEN

HOME PAGE

USER REGISTRATION

27
USER LOGIN

USER PROFILE

28
USER GALLERY

ADMIN LOGIN

29
ADMIN MANAGING FORUM

FRIENDS

30
8.2. APPENDIX-B SAMPLE CODING

Social.py

from flask import Flask ,flash,session,render_template,redirect,escape, url_for,request

import pymysql

import re

import os

#from app import app

import urllib.request

from werkzeug.utils import secure_filename

UPLOAD_FOLDER = 'static'

ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])

app = Flask(__name__)

app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

app.secret_key = 'your secret key'

conn=pymysql.connect (host='localhost',user='root',password='',db='social')

cur = conn.cursor()

31
def allowed_file(filename):

return '.' in filename and filename.rsplit('.', 1)[1].lower() in


ALLOWED_EXTENSIONS

@app.route('/home', methods=['GET','POST'])

def home():

user1=session['username']

dob=session['dob']

gender=session['gender']

mobilenumber=session['mobilenumber']

emailid=session['emailid']

cur.execute('select * from photo where username=%s',(user1,))

f=cur.fetchone()

filename=f[1

render_template('home.html',filename=filename,user=user1,dob=dob,gender=gender,mobil
enumber=mobilenumber,emailid=emailid)

@app.route('/index', methods=['GET','POST'])

def index():

return render_template('index.html')

@app.route('/logout', methods=['GET','POST'])

def logout():

session.pop('loggedin', None)

session.pop('id', None)

session.pop('username', None)
32
# Redirect to login page

return render_template('logout.html')

@app.route('/photos', methods=['GET','POST'])

def photos():

user1=session["username"]

cur.execute('select * from photo where username=%s',(user1,))

f=cur.fetchone()

filename1=f[1]

filename=""

if request.method=='POST':

file = request.files['file']

if file and allowed_file(file.filename):

filename = secure_filename(file.filename)

file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))

username=session["username"]

cur.execute('insert into gallery values(%s,%s)',(username,filename,))

conn.commit()

#print('upload_image filename: ' + filename)

flash('Image successfully uploaded')

cur.execute('select * from gallery where username=%s',(user1,))

gal=cur.fetchall()

return render_template('photos.html',filename=filename1,gal=gal)

@app.route('/post', methods=['GET','POST'])

def post():

33
username=session['username']

#post=request.

if request.method=='POST':

file = request.files['file']

if file and allowed_file(file.filename):

filename = secure_filename(file.filename)

file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))

username=session["username"]

cur.execute('insert into post values(%s,%s,%s)',(username,post,filename,))

conn.commit()

#print('upload_image filename: ' + filename)

flash('Image successfully uploaded')

return render_template('home.html')

@app.route('/profile', methods=['GET','POST'])

def profile():

firstname=session['firstname']

lastname=session['lastname']

user1=session['username']

dob=session['dob']

gender=session['gender']

mobilenumber=session['mobilenumber']

emailid=session['emailid']

cur.execute('select * from photo where username=%s',(user1,))

f=cur.fetchone()

34
filename=f[1]

return
render_template('profile.html',filename=filename,firstname=firstname,lastname=lastname,u
ser=user1,dob=dob,gender=gender,mobilenumber=mobilenumber,emailid=emailid)

@app.route('/signin', methods=['GET','POST'])

def signin():

msg = ''

username=''

# Check if "username" and "password" POST requests exist (user submitted form)

if request.method == 'POST' and 'username' in request.form and 'password' in


request.form:

# Create variables for easy access

username = request.form['username']

password = request.form['password']

cur.execute('SELECT * FROM registration WHERE username = %s AND password =


%s', (username, password,))

# Fetch one record and return result

account = cur.fetchone()

if account:

session['loggedin'] = True

session['firstname']=account[0]

session['lastname']=account[1]

session['username'] = username

session['dob']=account[3]

session['gender']=account[4]

session['mobilenumber']=account[5]

35
session['emailid']=account[6]

# Redirect to home page

return redirect(url_for('home'))

else:

# Account doesnt exist or username/password incorrect

msg='Incorrect username/password!'

return render_template('signin.html',msg=msg,user=username)

@app.route('/signin_form', methods=['GET','POST'])

def signin_form():

return render_template('signin_form.html')

@app.route('/signup', methods=['GET','POST'])

def signup():

# Output message if something goes wrong...

msg = ''

# Check if "username", "password" and "email" POST requests exist (user submitted
form)

if request.method == 'POST':

# Create variables for easy access

firstname = request.form['firstname']

lastname = request.form['lastname']

username = request.form['username']

dob = request.form['dob']

gender = request.form['gender']

36
mobilenumber = request.form['mobilenumber']

emailid = request.form['email']

password = request.form['password']

cur.execute('SELECT * FROM registration WHERE username = %s', (username,))

registration = cur.fetchone()

# If account exists show error and validation checks

if registration:

msg = 'Account already exists!'

elif not re.match(r'[^@]+@[^@]+\.[^@]+', emailid):

msg = 'Invalid email address!'

elif not re.match(r'[A-Za-z0-9]+', username):

msg = 'Username must contain only characters and numbers!'

elif not username or not password or not emailid:

msg = 'Please fill out the form!'

else:

# Account doesnt exists and the form data is valid, now insert new account into
accounts table

cur.execute('INSERT INTO registration VALUES (%s, %s, %s,%s,%s,%s,%s,%s)',


(firstname,lastname,username,dob,gender,mobilenumber,emailid,password))

conn.commit()

return redirect(url_for('home'))

return render_template('signup.html')

@app.route('/signup_form', methods=['GET','POST'])

37
def signup_form():

return render_template('signup_form.html')

@app.route('/timeline', methods=['GET', 'POST'])

def timeline():

return render_template('timeline.html')

@app.route('/friends', methods=['GET', 'POST'])

def friends():

cur.execute('SELECT * FROM registration')

registration = cur.fetchall()

return render_template('friends.html',registration=registration)

@app.route('/fprofile<friend>', methods=['GET', 'POST'])

def fprofile(friend):

cur.execute('SELECT * FROM registration where firstname=%s',(friend))

registration = cur.fetchone()

if registration:

firstname=session['firstname']

lastname=session['lastname']

user1=session['username']

dob=session['dob']

gender=session['gender']

mobilenumber=session['mobilenumber']

emailid=session['emailid']

38
return render_template('fprofile.html',registration=registration)

@app.route('/updatecover', methods=['GET', 'POST'])

def updatecover():

return render_template('updatecover.html')

@app.route('/deletecommemt', methods=['GET', 'POST'])

def deletecomment():

return render_template('delete_comment.html')

@app.route('/deletephotos', methods=['GET', 'POST'])

def deletephotos():

return render_template('deletephotos.html')

@app.route('/admin', methods=['GET', 'POST'])

def admin():

cur.execute('SELECT * FROM registration')

registration = cur.fetchall()

return render_template('admin.html',registration=registration)

@app.route('/user_info', methods=['GET', 'POST'])

def user_info():

cur.execute('SELECT * FROM registration')

registration = cur.fetchall()

return render_template('user_info.html',registration=registration)

39
@app.route('/report', methods=['GET', 'POST'])

def report():

cur.execute('SELECT * FROM registration')

registration = cur.fetchall()

return render_template('report.html',registration=registration)

@app.route('/editprofile', methods=['GET', 'POST'])

def editprofile():

firstname=session['firstname']

lastname=session['lastname']

user1=session['username']

dob=session['dob']

gender=session['gender']

mobilenumber=session['mobilenumber']

emailid=session['emailid']

if request.method == 'POST':

first=request.form["firstname"]

last=request.form["lastname"]

dob1=request.form["dob"]

gender1=request.form["gender"]

mobilenumber1=request.form["mobilenumber"]

cur.execute('UPDATE registration set


firstname=%s,lastname=%s,dob=%s,gender=%s,mobilenumber=%s WHERE
username=%s',(first,last,dob1,gender1,mobilenumber1,user1))

conn.commit()

40
return
render_template('editprofile.html',firstname=firstname,lastname=lastname,user=user1,dob=
dob,gender=gender,mobilenumber=mobilenumber,emailid=emailid)

@app.route('/updatephoto', methods=['GET', 'POST'])

def updatephoto():

filename=""

if request.method=='POST':

file = request.files['file']

if file and allowed_file(file.filename):

filename = secure_filename(file.filename)

file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))

username=session["username"]

cur.execute('insert into photo values(%s,%s)',(username,filename,))

conn.commit()

#print('upload_image filename: ' + filename)

flash('Image successfully uploaded')

return render_template('updatephoto.html',filename=filename)

@app.route('/display/<filename>')

def display(filename):

#print('display_image filename: ' + filename)

username=session['username']

cur.execute('select * from photo where username=%s',(username,))

f=cur.fetchone()

filename=f[1]

41
return redirect(url_for('static', filename=filename), code=301)

if __name__ == '__main__':

app.run()

Signin.html
<!DOCTYPE html>
<html>

<head>
<title>Welcome To Biobook - Sin up, Log in, Chat </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/signin.css')}}">
</head>

<body>

<div id="container">
<div class="sign-in-form">
<table>
<h1>Welcome to Biobook</h1>
<h2>Log in</h2>
<form method="post">
<tr>
<td><label>Username</label></td>
<td><input type="text" name="username"
placeholder="username" class="form-1" title="Enter username" required /></td>
</tr>
<tr>
<td><label>Password</label></td>
<td><input type="password" name="password"
placeholder="~~~~~~~~~~" class="form-1" title="Enter your password" required /></td>

42
</tr>
{{msg}}
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Log in"
class="btn-sign-in" title="Log in" />
<input type="reset" name="cancel" value="Cancel"
class="btn-sign-up" title="Cancel" /><br>
</td>
</tr>
</form>
<tr>
<td><label>NewUser</label></td>
<td colspan="4"><a href="{{url_for('signup')}}"
title="Register"><button class="btn-sign-in" value="Register">Register</button></a></td>
</td>
</tr>

</table>

</div>
</div>
43
</body>

</html>

Signup.html :
<!DOCTYPE html>
<html>

<head>
<title>Register - Sin up, Log in, Chat </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/signup.css')}}">
</head>

<body>

<div id="container">
<div class="sign-in-form">
<center>
<h1>REGISTER</h1>
</center>

<h2>Sign up</h2>
<b>All fields are required.</b>
<br />

<fieldset class="sign-up-form-1">
<form method="post" >
<table cellpadding="5" cellspacing="5">
<tr>
<td><label>First name*</label></td>
<td><label>Last name *</label></td>
</tr>
<tr>

44
<td><input type="text" name="firstname"
placeholder="Enter your firstname....." class="form-1" title="Enter your firstname" required
/></td>
<td><input type="text" name="lastname"
placeholder="Enter your lastname....." class="form-1" title="Enter your lastname" required
/></td>
</tr>
<tr>
<td><label>User name*</label></td>
<td><label>Repeat user name*</label></td>
</tr>
<tr>
<td><input type="text" name="username"
placeholder="Enter your username....." class="form-1" title="Enter your username"
required /></td>
<td><input type="text" name="username2"
class="form-1" title="Enter your username" required /></td>
</tr>
<tr>
<td colspan="2">Note: No one can follow your
username.</td>
</tr>
</table>
</fieldset>

<br />

<fieldset class="sign-up-form-1">
<legend>Profile information</legend>
<table cellpadding="5" cellspacing="5">
<tr>
<td><label>Birthday</label></td>
<td><input type="text" name="dob"
placeholder="Enter your Date of Birth"></td>
</tr>
<tr>
45
<td><label>Gender</label></td>
<td>
<label>Male</label><input type="radio"
name="gender" value="male" required />
<label>Female</label><input type="radio"
name="gender" value="female" required />
</td>
</tr>
<tr>
<td><label>Mobile number*</label></td>
<td><input type="text" name="mobilenumber"
placeholder="09...." maxlength="13" class="form-1" title="Enter your mobile number"
required /></td>
</tr>
</table>
</fieldset>

<br />

<fieldset class="sign-up-form-1">
<legend>Log in information*</legend>
<table cellpadding="5" cellspacing="5">
<tr>
<td><label>Your email address*</label></td>
<td><label>Repeat email *</label></td>
</tr>
<tr>
<td><input type="text" name="email"
placeholder="Enter your email address....." class="form-1" title="Enter your firstname"
required /></td>
<td><input type="text" name="email2" class="form-
1" title="Enter your lastname" required /></td>
</tr>
<tr>
<td colspan="2">Note: no-one can see your email
address.</td>
46
</tr>
<tr>
<td><label>Password*</label></td>
<td><label>Repeat password*</label></td>
</tr>
<tr>
<td><input type="password" name="password"
placeholder="Enter your password....." class="form-1" title="Enter your username"
required /></td>
<td><input type="password" name="password2"
class="form-1" title="Enter your username" required /></td>
</tr>
<tr>
<td colspan="2">Note: no-one else can see your
password.</td>
</tr>
</table>
</fieldset>

<br />

<strong>Yes, I have read and I accept the <a href="#">Biobook


Terms of Use</a> and the <a href="#">Biobook Privacy Statement</a></strong>

<br />
<br />
<input type="submit" name="submit" value="I Agree
- Continue" class="btn-sign-in" title="Log in" />
</form>

</div>
</div>

</body>

</html>
47
admin.html :
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/signin.css')}}">
</head>

<body>

<div id="container">
<div class="sign-in-form">
<table>
<h1>ADMIN LOGIN</h1>
<form method="post">
<tr>
<td><label>Username</label></td>
<td><input type="text" name="username"
placeholder="username" class="form-1" title="Enter username" required /></td>
</tr>
<tr>
<td><label>Password</label></td>
<td><input type="password" name="password"
placeholder="~~~~~~~~~~" class="form-1" title="Enter your password" required /></td>

</tr>
{{msg}}
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
48
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Log in"
class="btn-sign-in" title="Log in" />
<input type="reset" name="cancel" value="Cancel"
class="btn-sign-up" title="Cancel" /><br>
</td>
</tr>
</form>

</table>

</div>
</div>

</body>

</html>

User_info.html :
<!DOCTYPE html>
<html>

<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/profile.css')}}">
</head>
<body>

49
<form >
<h1>USER INFORMATION</h1>
<hr />
<br />
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('user_info')}}" title="User
Info"><label>user information</label></a></li>
<li><a href="{{url_for('report')}}" title="Report"><label
>report</label></a></li>
<div class='info-user'>
<div>
<table border='2'>
<form method="post">
{% for col in registration %}
<tr><h3> <td>{{ col[0] }}</td></h3>
<h3> <td>{{ col[1] }} </td></h3>
<h3> <td>{{ col[2] }} </td></h3>
<h3> <td>{{ col[3] }} </td></h3>
<h3> <td>{{ col[4] }} </td></h3>
<h3> <td>{{ col[5] }} </td></h3>
<h3> <td>{{ col[6] }} </td></h3>
<h3> <td>{{ col[7] }} </td></h3></tr>
{% endfor %}
</div>
</form>
</body>

</html>
home.html :
<!DOCTYPE html>
<html>

<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
50
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/home.css')}}">
</head>

<body>

<form method=post>
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('home')}}"
title="Biobook"><b>biobook</b></a></li>
<li><a href="{{url_for('timeline')}}"
title="{{user}}"><label>{{user}}</label></a></li>
<li><a href="{{url_for('home')}}" title="Home"><label
class="active">Home</label></a></li>
<li><a href="{{url_for('profile')}}"
title="Home"><label>Profile</label></a></li>
<li><a href="{{url_for('photos')}}"
title="Settings"><label>Gallery</label></a></li>
<li><a href="{{url_for('friends')}}"
title="Friends"><label>Friends</label></a></li>
<li><a href="{{url_for('logout')}}" title="Log out"><button
class="btn-sign-in" value="Log out">Log out</button></a></li>
</ul>
</div>
</div>
</form>
<form method=post>
<div id="container">

<div id="left-nav">

<div class="clip1">

51
<a href="{{url_for('updatephoto')}}" title="Change Profile
Picture"><img src="{{url_for('static',filename=filename)}}">
</a>
</div>

<div class="user-details">
<h3>{{firstname}}&nbsp;{{lastname}}</h3>
<h2>{{user }}</h2>
</div>
</div>
</form>

<div id="right-nav">
<h1>Update Status</h1>
<div>
<form method="post" action="{{url_for('post')}}" >
<textarea placeholder="Whats on your mind?"
name="content" class="post-text" required></textarea>
<input type="file" name="file">
<button class="btn-share" name="Submit" value="Log
out">Share</button>
</form>
</div>

</div>

<div id="left-nav1">
<h2>Personal Info</h2>
<table>
<tr>
<td><label>Username</label></td>
<td width="20"></td>
<td><b>{{user}}</b></td>
</tr>
52
<tr>
<td><label>Birthday</label></td>
<td width="20"></td>
<td><b>{{dob}}</b></td>
</tr>
<tr>
<td><label>Gender</label></td>
<td width="20"></td>
<td><b>{{gender}}</b></td>
</tr>
<tr>
<td><label>Contact</label></td>
<td width="20"></td>
<td><b>{{mobilenumber}}</b></td>
</tr>
<tr>
<td><label>Email</label></td>
<td width="20"></td>
<td><b>{{emailid}}</b></td>
</tr>

</table>
</div>

<div id="right-nav1">
<div class="profile-pics">
<img src="{{profile_picture }}">
<b>{{posted_by }}</b>
<strong>{{time}}</strong>
</div>
<br />
<div class="post-content">
<div class="delete-post">

53
<a href="delete_post.php<?php echo '?id='.$post_id; ?>"
title="Delete your post"><button class="btn-delete">X</button></a>
</div>
<p>{{'content'}}</p>
<center>
<img src="{{location}}">
</center>
</div>

<div class="comment-display"{{comment_id}}>>
<div class="delete-post">
<a href="" title="Delete your comment"><button
class="btn-delete">X</button></a>
</div>
<div class="user-comment-name"><img
src="{{image}}">&nbsp;&nbsp;&nbsp;<?php echo $row['name']; ?><b class="time-
comment"><?php echo $time = time_stamp($time); ?></b></div>
<div class="comment"><?php echo
$row['content_comment']; ?></div>

</div>
<br />
<form method="POST" >
<div class="comment-area">

<img src="<?php echo $row['profile_picture']; ?>" width="50"


height="50">

<input type="text" name="content_comment" placeholder="Write a


comment..." class="comment-text">
<input type="hidden" name="post_id" value="<?php echo $post_id
?>">
<input type="hidden" name="user_id" value="<?php echo $firstname
. ' ' . $lastname ?>">

54
<input type="hidden" name="image" value="<?php echo
$profile_picture ?>">
<input type="submit" name="post_comment" value="Enter"
class="btn-comment">

</div>
</form>
</div>
</div>
</form>
</body>

</html>
Profile.html :
<!DOCTYPE html>
<html>

<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/profile.css')}}">
</head>

<body>
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('home')}}"
title="Biobook"><b>biobook</b></a></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>

55
<li><a href="{{url_for('timeline')}}"
title="<{{user}}>"><label><{{user}}></label></a></li>
<li><a href="{{url_for('home')}}"
title="Home"><label>Home</label></a></li>
<li><a href="{{url_for('profile')}}" title="Profile"><label
class="active">Profile</label></a></li>
<li><a href="{{url_for('photos')}}"
title="Settings"><label>Gallery</label></a></li>
<li><a href="{{url_for('friends')}}"
title="Friends"><label>Friends</label></a></li>
<li><a href="{{url_for('logout')}}" title="Log out"><button
class="btn-sign-in" value="Log out">Log out</button></a></li>
</ul>
</div>
</div>

<div id="container">

<div id="left-nav">
<form method="post">

<div class="clip1">
<a href="{{url_for('updatephoto')}}" title="Change Profile
Picture"><img src="{{url_for('static',filename=filename)}}">
</a>

</div>
</form>

<div class="user-details">
<h3>{{firstname}}&nbsp;{{lastname}}</h3>
<h2>{{user}}</h2>
</div>
</div>

<form method="post">
56
<div id="right-nav">
<h1>Personal Info</h1>
<hr />
<br />
<div class='info-user'>
<div>

<label>Firstname</label>&nbsp;&nbsp;&nbsp;<b>"{{firstname}}"</b>
</div>
<hr />
<br />
<div>

<label>Lastname</label>&nbsp;&nbsp;&nbsp;&nbsp;<b>"{{lastname}}"</b>
</div>
<hr />
<br />
<div>

<label>Username</label>&nbsp;&nbsp;&nbsp;<b>"{{user}}"</b>
</div>
<hr />
<br />
<div>

<label>Birthday</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>"{{dob}}"</b>
</div>
<hr />
<br />
<div>

<label>Gender</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;<b>"{{gender}}"</b>
</div>
57
<hr />
<br />
<div>
<label>Mobile
Number</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>"{{mobilenu
mber}}"</b>
</div>
<hr />
<br />
</div>
<br />
<div class='edit-info'>
<a href ="{{url_for('editprofile')}}">Edit Profile</a>
</div>
</form>
</body>
</html>

friends.html :
<!DOCTYPE html>
<html>

<head>
<title>Welcome To Biobook - Sign up, Log in, Post </title>
<link rel="stylesheet" type="text/css"
href="{{url_for('static',filename='css/profile.css')}}">
</head>

<body>
<form method="post">
<div id="header">
<div class="head-view">
<ul>
<li><a href="{{url_for('home')}}"
title="Biobook"><b>biobook</b></a></li>

58
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><a href="{{url_for('timeline')}}"
title="<{{user}}>"><label><{{user}}></label></a></li>
<li><a href="{{url_for('home')}}"
title="Home"><label>Home</label></a></li>
<li><a href="{{url_for('profile')}}" title="Profile"><label
>Profile</label></a></li>
<li><a href="{{url_for('photos')}}"
title="Settings"><label>Gallery</label></a></li>
<li><a href="{{url_for('friends')}}" title="Friends"><label
class="active">Friends</label></a></li>
<li><a href="{{url_for('logout')}}" title="Log out"><button
class="btn-sign-in" value="Log out">Log out</button></a></li>
</ul>
</div>
</div>

</form>

<div id="right-nav">
<form >
<h1>FRIENDS </h1>
<hr />
<br />
<div class='info-user'>
<div>
<table border='1'>
{% for col in registration %}
<h3> <tr>{{ col[2] }}

59
<button> <a href ="{{url_for('fprofile',friend="{{f}}")}}">View
profile</button></a>
<br></tr></h3><br>

{% endfor %}

</div>
<br />
<br />
</form> <br />

</div>

</div>
</form>
</body>
</html>

Post.html :
<?php
include('includes/database.php');
include('session.php');

if
(!isset($_FILES['image']['tmp_name'])) {
echo "";
}else{
$file=$_FILES['image']['tmp_name'];
$image = $_FILES["image"] ["name"];
$image_name=
addslashes($_FILES['image']['name']);
$size = $_FILES["image"] ["size"];
$error = $_FILES["image"] ["error"];

if ($error > 0){


60
die("Error
uploading file! Code $error.");
}else{
if($size >
10000000) //conditions for the file
{
die("Format is
not allowed or file size is too big!");
}

else
{

move_uploaded_file($_FILES["image"]["tmp_name"],"upload/" .
$_FILES["image"]["name"]);
$location="upload/" .
$_FILES["image"]["name"];
$user=$_SESSION['id'];

$content=$_POST['content'];
$time=time();

$update=mysql_query("
INSERT INTO post (user_id,post_image,content,created)
VALUES
('$id','$location','$content','$time') ") or die (mySQL_error());

61
9.FUTURE ENHANCEMENT

Further requirements and improvements can easily be done since the coding is
mainly structured or modular in nature. Changing the existing modules or adding new
modules can append improvements. Further enhancements can be made to the application,
so that the web site functions very attractive and useful manner than the present one. This
forum can be enhanced as discussion forum. It can be added with more categories to make
this forum more interactive. Commenting options can be added. To encourage user, like and
share option can be added which makes user to take part in forum actively.

62
10.BIBILIOGRAPHY

❖ Fluent Python: Clear, Concise, and Effective Programming, by Luciano Ramalho


❖ “Python Tricks: A Buffet of Awesome Python Features” by Daniel Bader
❖ Learn Python 3 The Hard Way, by Zed A. Shaw
❖ Head First Python: A Brain-Friendly Guide, by Paul Barry
❖ High Performance MySQL: Optimization, Backups, Replication, and More, by
Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy Zawodny, Arjen
Lentz, Derek J. Balling.
❖ MySQL Cookbook, by Paul DuBois.
❖ MYSQL in a Nutshell, by Russell Dyer
❖ MySQL High Availability: Tools for Building Robust Data Centers, by Charles
Bell, Mats Kindahl, Lars Thalmann.

63

You might also like