News Blog1
News Blog1
And Managemnet
i
STUDENT’S DECLARATION
I, HARSH MITTAL, hereby declare that this work entitled “CLASSMATE” is the
result of final year undertaken. The findings and conclusions expressed in this
report are genuine, authentic and are for academic purpose. Any resemblance to
earlier research work is purely coincidental.
HARSH MITTAL
(MCA 3RD SEM)
Roll No: 2301730140014
ii
SUPERVISON CERTIFICATION
I Mr. Saiyam Varshney, hereby certify that this research work entitled “News
Blog Website” is the result of the research under taken by Harsh Mittal
(2301730140014) the finding and conclusion expressed in this report are genuine,
authentic and are for academic purpose only. Any resemblance to earlier work is
purely coincidental.
(Project Guidence)
iii
ABSTRACT
The News Blog Website project is designed to provide a dynamic and user-friendly
platform for browsing, managing, and interacting with news articles. The growing
demand for online content delivery platforms motivated the development of this
project, aimed at offering an intuitive interface and efficient content management
system. The platform caters to users seeking categorized news updates and
administrators managing the publication process.
The project utilizes HTML, CSS, PHP, and MySQL as the primary technologies.
The front-end ensures a responsive and visually appealing user experience, while
the back-end handles user authentication, article management, and data storage.
The development process followed the Software Development Life Cycle (SDLC)
methodology to ensure systematic planning, implementation, and testing. Features
such as search functionality, comment posting, and secure login mechanisms
were implemented and thoroughly tested.
The results achieved include a fully functional, scalable, and interactive news blog
website. Users can easily browse articles, search for specific content, and engage
via comments, while administrators efficiently manage news categories, articles,
and user activity. The system was rigorously tested to ensure reliability, security,
and usability.
iv
ACKNOWLEDGEMENT
I would like to express my heartfelt gratitude to my project supervisor, Mr.Saiyam
Varshney, for their invaluable guidance, encouragement, and support throughout
the development of this News Blog Website project. Their expert insights and
constructive feedback were instrumental in overcoming challenges and achieving
the project’s objectives.
I am also sincerely thankful to Mr. Durgesh Nandn Pathak, Head of Department, for
providing the necessary resources, guidance, and motivation to successfully
complete this project. Their leadership and support created a conductive
environment for learning and innovation.
I would also like to thank my peers and colleagues for their collaboration and
suggestions, which greatly contributed to the success of this project. Additionally, I
am grateful to the online platforms and communities that provided technical
resources and solutions, enabling me to refine and enhance this work.
Lastly, I extend my gratitude to my family and friends for their unwavering support
and encouragement throughout this journey. Their belief in me has been a
constant source of inspiration.
HARSH MITTAL
MCA 3rd Sem
v
TABLE OF CONTENTS
STUDENT’S DECLARATION…………………………………………………………Ⅱ
SUPERVISON CERTIFICATION……………………………………………………...Ⅲ
ABSTRACT…………………………………………………………………………….. .Ⅳ
ACKNOWLEDGMENT………………………………………………………………….Ⅴ
INTRODUCTION………………………………………………………………………...6
OBJECTIVE………………………………………………………………………………7
FEASIBILITY STUDY……………………………………………………………………8
SRS…………………………………………………………………………………….9-10
SDLC………………………………………………………………………………….11-13
DFD…………………………………………………………………………………...14-15
ER-DIAGRAM………………………………………………………………………..16-17
DESIGN &USER INTERFACE……………………………………………………..18-21
DATABSE…………………………………………………………………………….22-23
CODING………………………………………………………………………………24-31
TESTING……………………………………………………………………………..32-34
SCOPE OF THE PROJECT………………………………………………………..35-36
CONCLUSION……………………………………………………………………….37
BIBLIOPHILE………………………………………………………………………...38
vi
INTRODUCTION
This project involves developing a dynamic news blog website using HTML,
CSS, PHP, and MySQL. The primary goal of the website is to provide a
platform where users can access the latest news articles, categorized by
topics, in an organized and user-friendly manner.
Key Features:
OBJECTIVE
The objective of this project is to create a news blog website that provides
users with up-to-date news articles in an organized and easy-to-use format. It
aims to offer a responsive and user-friendly platform where users can browse
news by category, search for specific topics, and interact with the content
through comments. The website will include a dynamic backend system for
managing articles, users, and categories, making it easy for administrators to
update content
7
FEASIBILTY STUDY
The feasibility of the news blog website project can be evaluated in terms of
technical, operational, economic, and time-based factors:
1. Technical Feasibility
o The technologies required (HTML, CSS, PHP, and MySQL) are
widely available and well-documented, making development
straightforward.
o The tools and frameworks needed, such as a local server (e.g.,
XAMPP) and a text editor or IDE, are accessible and easy to set
up.
o The team’s skills in these technologies are adequate for
implementing the website's features.
2. Operational Feasibility
o The project meets the needs of both users and administrators by
providing an interactive platform for browsing and managing
news.
o The design ensures the website is user-friendly and responsive,
making it suitable for diverse audiences.
o The backend system will simplify administrative tasks, ensuring
smooth operation.
3. Economic Feasibility
o The cost of development is low as the tools and technologies
used are either free or have minimal expenses.
o No significant hardware or software investments are required
beyond standard development tools.
4. Time-Based Feasibility
o The project is manageable within a reasonable timeframe due to
its straightforward scope.
o Development can be divided into smaller, achievable phases,
ensuring timely progress and completion.
8
SOFTWARE REQUIREMENT SPECIFICATION
This document specifies the functional and non-functional requirements for the
development of a dynamic news blog website. It will serve as a guide to ensure
the proper implementation of the system.
System Features
1. User Features
o View news articles categorized by topics.
o Search articles by keywords.
o Register and log in for personalized features.
o Comment on news articles.
2. Admin Features
o Add, edit, and delete news articles and categories.
o Manage user accounts and permissions.
o View and moderate user comments.
Functional Requirements
1. Frontend Requirements
o Display news articles with titles, summaries, and images.
o Provide navigation for categories and search functionality.
o Support responsive design for compatibility across devices.
2. Backend Requirements
o Server-side scripting to manage dynamic content (PHP).
o Database operations for CRUD functionalities (MySQL).
3. Database Requirements
o Tables for users, news articles, categories, and comments.
o Secure storage of user credentials with encryption.
o Efficient querying for retrieving and displaying content.
4. User Management
o Registration and login system with validation.
9
o Role-based access control for users and administrators.
1. Hardware Requirements
o Client Device: Any device with a web browser (desktop, tablet, or
smartphone).
o Server: At least 4GB RAM, dual-core processor, and 20GB
storage for hosting.
2. Software Requirements
o Development Tools: Visual Studio Code, XAMPP/WAMP.
o Database: MySQL.
o Backend: PHP 7.4 or later.
o Frontend: HTML5, CSS3, and optionally JavaScript for
interactivity.
10
SOFTWARE DEVELOPMENT LIFE CYCLE
The SDLC is divided into several phases, each focusing on specific tasks and
deliverables. These phases typically include:
1. Planning
2. Requirements Analysis
Activities:
11
o Engage stakeholders through interviews, surveys, and
workshops.
o Create detailed requirements documentation (e.g., Software
Requirement Specification - SRS).
o Analyze system constraints and dependencies.
3. Design
4. Implementation (Coding)
5. Testing
12
6. Deployment
7. Maintenance
13
DATA FLOW DIAGRAM
Data Flow Diagram (DFD) represents the flow of data within information
systems. Data Flow Diagrams (DFD) provide a graphical representation of the
data flow of a system that can be understood by both technical and non-
technical users. The models enable software engineers, customers, and users
to work together effectively during the analysis and specification of
requirements.
14
0-LEVEL DFD
USER
BLOGGERS SITE
Picture
Upload
EDIT
PROFILE
User Verify
Sign up Table
Accept/Deny
LOG IN Insert
Sign up Table
Created
New User
15
ER-DIAGRAM
The Entity Relationship Model is a model for identifying entities to be
represented in the database and representation of how those entities are
related. The ER data model specifies enterprise schema that represents the
overall logical structure of a database graphically.
16
Components of ER Diagram
ER Model consists of Entities, Attributes, and Relationships among Entities in
a Database System.
u-id pass
name
username
View blog
USER does
17
DESIGN & USER INTERFACE
HOME PAGE:
18
CATEGORY WISE PAGE:
19
Admin Page:
UPDATE USERS
20
UPDATE POST
21
DATABASE
POST TABLE:-
USERS TABLE:-
22
CATEGORY TABLE:-
23
CODING
Config.php
<?php
$conn = mysqli_connect("localhost","root","","news") or die("connection
failed".mysqli_connect_error());
?>
HEADER
<?php
include "config.php";
$page = basename($_SERVER['PHP_SELF']);
switch($page){
case "single.php":
if(isset($_GET['id'])){
$sql_title = "SELECT * FROM post WHERE post_id = {$_GET['id']}";
$result_title = mysqli_query($conn,$sql_title);
$row_title = mysqli_fetch_assoc($result_title);
$page_title = $row_title['title'];
}else{
$page_title = "No Result Found";
}
break;
case "category.php":
if(isset($_GET['cid'])){
$sql_title = "SELECT * FROM category WHERE category_id =
{$_GET['cid']}";
$result_title = mysqli_query($conn,$sql_title);
$row_title = mysqli_fetch_assoc($result_title);
$page_title = $row_title['category_name'];
}else{
$page_title = "No Result Found";
}
break;
case "author.php":
if(isset($_GET['id'])){
$sql_title = "SELECT * FROM user WHERE user_id =
{$_GET['aid']}";
$result_title = mysqli_query($conn,$sql_title);
$row_title = mysqli_fetch_assoc($result_title);
$page_title = $row_title['first_name'] ." " .$row_title['last_name'];
}else{
$page_title = "No Result Found";
}
break;
24
case "search.php":
if(isset($_GET['search'])){
$page_title = $_GET['search'];
}else{
$page_title = "No Result Found";
}
break;
default:
$page_title = "News Site";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- The above 3 meta tags *must* come first in the head; any other head
content must come *after* these tags -->
<title><?php $page_title;?></title>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css" />
<!-- Font Awesome Icon -->
<link rel="stylesheet" href="css/font-awesome.css">
<!-- Custom stlylesheet -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- HEADER -->
<div id="header">
<!-- container -->
<div class="container">
<!-- row -->
<div class="row">
<!-- LOGO -->
<div class=" col-md-offset-4 col-md-4">
<a href="index.php" id="logo"><img src="images/news.jpg"></a>
</div>
<!-- /LOGO -->
</div>
</div>
</div>
<!-- /HEADER -->
<!-- Menu Bar -->
<div id="menu-bar">
<div class="container">
<div class="row">
25
<div class="col-md-12">
<?php
include "config.php";
if(isset($_GET['cid'])){
$cat_id = $_GET['cid'];
}
// category show
$sql = "SELECT * FROM category where post > 0";
$result = mysqli_query($conn,$sql) or die ("Query failed : Category");
if(mysqli_num_rows($result)>0){
$active = "";
?>
<ul class='menu'>
<li><a class='' href='index.php'>HOME</a></li>
<?php
//Menu bar
while($row = mysqli_fetch_assoc($result)){
//for show the highlight category
if(isset($_GET['cid'])){
if($row['category_id'] == $cat_id){
$active = "active";
}else{
$active = "";
}
}
echo"<li><a class='{$active}'
href='category.php?cid={$row['category_id']}'>{$row['category_name']}</a></li>
";
}
?>
</ul>
<?php
}
?>
</div>
</div>
</div>
</div>
<!-- /Menu Bar -->
Footer
<div id ="footer">
<div class="container">
<div class="row">
<div class="col-md-12">
<span>© Copyright 2024 News | Powered by <a href="">Harsh
26
Mittal</a></span>
</div>
</div>
</div>
</div>
</body>
</html>
LOGIN
}
}else{
echo "<div class = 'alert alert-danger'>Username and Password are Not
matched</div>";
}
}
?>
<!doctype html>
<html>
27
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ADMIN | Login</title>
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<link rel="stylesheet" href="font/font-awesome-4.7.0/css/font-
awesome.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div id="wrapper-admin" class="body-content">
<div class="container">
<div class="row">
<div class="col-md-offset-4 col-md-4">
<img class="logo" src="images/news.jpg">
<h3 class="heading">Admin</h3>
<!-- Form Start -->
<form action="<?php $_SERVER['PHP_SELF'];?>" method
="POST">
<div class="form-group">
<label>Username</label>
<input type="text" name="username" class="form-control"
placeholder="" required>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" class="form-
control" placeholder="" required>
</div>
<input type="submit" name="login" class="btn btn-primary"
value="login" />
</form>
<!-- /Form End -->
</div>
</div>
</div>
</div>
</body>
</html>
SAVE-POST:-
<?php
include "config.php";
if(isset($_FILES['fileToUpload'])){
// For upload the file which will in the only form of image
$errors = array();
$file_name = $_FILES['fileToUpload']['name'];
28
$file_size = $_FILES['fileToUpload']['size'];
$file_tmp = $_FILES['fileToUpload']['tmp_name'];
$file_type = $_FILES['fileToUpload']['type'];
$file_ext = strtolower(end(explode(".",$file_name)));
$extension = array("jpeg","jpg","png","jfif");
}
session_start();
$title = mysqli_real_escape_string($conn,$_POST['post_title']);
$description = mysqli_real_escape_string($conn,$_POST['postdesc']);
$category = mysqli_real_escape_string($conn,$_POST['category']);
$date = date("d M, Y");
$author = $_SESSION['user_id'];
ADD-USERS:-
29
if($_SESSION['role'] == 0){
header("Location:http://localhost/news-template/admin/post.php");
}
if(isset($_POST['save'])){
include"config.php";
$fname = mysqli_real_escape_string($conn,$_POST['fname']);
$lname = mysqli_real_escape_string($conn,$_POST['lname']);
$user = mysqli_real_escape_string($conn, $_POST['user']);
$password = mysqli_real_escape_string($conn, md5($_POST['password']));
$role = mysqli_real_escape_string($conn,$_POST['role']);
$sql = "SELECT username from user WHERE username = '{$user}'";
$result = mysqli_query($conn,$sql) or die("Query Failed");
if(mysqli_num_rows($result)>0){
echo'<script>alert("Username already exist")</script>';
}else{
$sql1 = "INSERT INTO user
(first_name,last_name,username,password,role) VALUES
('{$fname}','{$lname}','{$user}','{$password}','{$role}')";
if(mysqli_query($conn,$sql1)){
header("Location:http://localhost/news-template/admin/users.php");
}
}
}
PAGINATION:-
// Pagination
$sql1 = "SELECT * FROM post";
$result1 = mysqli_query($conn,$sql1);
if(mysqli_num_rows($result1)>0){
$total_records = mysqli_num_rows($result1);
$total_page = ceil($total_records/$limit);
echo"<ul class='pagination admin-pagination'>";
if($page>1){
echo'<li><a href="index.php?page='.($page-1).'">Prev</a></li>';
}
for($i =1;$i<=$total_page;$i++){
if($i == $page){
$active = "active";
}else{
$active = "";
}
30
if($total_page>$page){
echo'<li><a
href="index.php?page='.($page+1).'">Next</a></li>';
}
echo"</ul>";
}
?>
31
TESTING
The following testing plan ensures that the news blog website meets its
functional and non-functional requirements, is user-friendly, and operates
without issues.
1. Unit Testing
2. Integration Testing
Test the integration of the login system with the user database.
Verify the connection between the article management feature in the
admin panel and the main website.
Check that the search feature retrieves relevant articles from the
database.
3. System Testing
32
Test navigation links, buttons, and forms across all pages.
4. Acceptance Testing
5. Performance Testing
6. Security Testing
7. Regression Testing
33
Test user registration and login after implementing changes to the
search feature.
Verify article management functions after updating the comment system.
8. Usability Testing
Verify the navigation bar is easy to use and all links work.
Ensure text and images are clearly visible on all devices.
Test error messages (e.g., for failed login or invalid form inputs) for
clarity and helpfulness.
This comprehensive testing plan ensures the news blog website functions
smoothly, providing a seamless and secure user experience while meeting all
specified requirements.
34
SCOPE OF THE PROJECT
The scope of the news blog website project defines the features, functionalities,
and objectives the system aims to achieve. It outlines the boundaries of the
project and the expected deliverables.
Inclusions
1. User Features:
o Browse news articles categorized by topics (e.g., politics, sports,
technology).
o Search for articles using keywords.
o Comment on articles to engage with content.
o User registration and login for personalized features.
2. Admin Features:
o Add, edit, and delete articles and categories dynamically.
o Manage user accounts and their permissions.
o Moderate user comments to maintain quality content.
3. Content Management:
o Store articles in a database with associated metadata (e.g., title,
author, date, category).
o Organize content into categories for better user navigation.
4. Responsive Design:
o Ensure compatibility across devices such as desktops, tablets,
and mobile phones.
5. Security Measures:
o Protect user data with encryption (e.g., for passwords).
o Implement secure login/logout mechanisms.
o Validate inputs to prevent SQL injection and other vulnerabilities.
6. Performance and Usability:
o Optimize website speed and loading times.
o Provide an intuitive and easy-to-use interface for both users and
administrators.
35
Exclusions
Constraints
The system will initially be developed and tested on a local server before
deployment to a live environment.
The database is designed to handle a limited number of concurrent
users and articles in the initial phase.
Deliverables
This project aims to provide a scalable and efficient platform for delivering news
to users while being simple to manage and expand in the future.
36
CONCLUSION
The News Blog Website project successfully achieves its objective of providing
a dynamic and interactive platform for delivering news content to users. With its
user-friendly interface, robust functionality, and efficient content management
system, the website enables users to easily browse articles, search for specific
content, and engage through comments, while administrators can effectively
manage news articles and user activities.
This project not only demonstrates the technical feasibility of creating a news
blog platform but also highlights its relevance in the modern digital age, where
access to information is vital. Future enhancements, such as integrating real-
time news updates, multilingual support, and advanced analytics, can further
expand the website's capabilities and user appeal.
In conclusion, the project serves as a practical and valuable solution for online
news delivery, meeting the needs of both users and administrators effectively.
37
BIBLIOPHILE
WWW.WIKIPEDIA.COM
WWW.PHP.COM
WWW.GEEKSFORGEEKS
WWW.STACKOVERFLOW
WWW.GOOGLE.COM
38