You are on page 1of 51

MINI PROJECT REPORT

ON
E-RENTAL SYSTEM
Submitted in partial fulfillment of the requirements for the award of
Bachelor of Technology
In
Computer Science and Engineering
By
Shaik Safura Samreen (20C31A0559)
Mirza Rafathullah Baig (20C31A0536)
Sanga Ravalika (20C31A0557)
Mohammad Amaan (20C31A0539)

Under The Esteemed Guidance of


Mr. ASHISH LADDA
Assistant Professor, Department of CSE

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

BALAJI INSTITUTE OF TECHNOLOGY AND SCIENCE


Accredited by NBA (UG-CE, EC, ME, CSE, EEE Programs) & NAAC A+ Grade (Affiliated to JNTU
Hyderabad and Approved by the AICTE, New Delhi)

NARSAMPET, WARANGAL – 506331.


BALAJI INSTITUTE OF TECHNOLOGY & SCIENCE
Accredited by NBA (UG-CE, ECE, ME, CSE Programs) & NAAC A+ Grade
(Affiliated by JNTU Hyderabad and Approved by the AICTE, New Delhi)
NARSAMPET, WARANGAL – 506331.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that Shaik Safura Samreen(20C31A0559), Mirza Rafathullah Baig (20C31A0536),

Sanga Ravalika (20C31A0557) and Mohammad Amaan (20C31A0539) of B. Tech IV–I Sem has

satisfactorily completed the Mini Project entitled “e-RENTAL SYSTEM”, as part of curriculum in

Computer Science Engineering during academic year 2023-2024 .

Name of Supervisor Head of Department

Mr. ASHISH LADDA Mr. B. KRISHNA


Assistant Professor Associate professor
Department of CSE Head of Department of CSE
BITS, Narsampet-506331 BITS, Narsampet-506331

External Examiner
ACKNOWLEDGEMENT

We would like to express our sincere gratitude to our guide, Mr. Ashish Ladda whose
knowledge and guidance have motivated us to achieve goals. We never thought possible. He
has consistently been a source of motivation, encouragement and inspiration. The time we
have spent working under his supervision has truly been a pleasure.

We thank our HOD, Mr. B. Krishna of his effort and guidance and all senior faculty members
for their help during our course. Thanks to programmers and non-teaching staff of CSE
Department of our college.

We heartily thank to our Principal Dr. V. S. HARIHARAN for giving this great opportunity and
his support to complete our project.

We would to appreciate the guidance given by project coordinator as well as the panels
especially in our project presentation that has improved our presentation skills by their
comment and tips.

Finally Special thanks to our parents for their support and encouragement throughout our
life and this course. Thanks to all my friends and well-wishers for their constant support.

Shaik Safura Samreen 20C31A0559


Mirza Rafathullah Baig 20C31A0536
Sanga Ravalika 20C31A0557
Mohammad Amaan 20C31A0539
ABSTRACT

This research paper presents an e-Rental System. The system allows tenants to
search for houses, compare prices, and book houses online. The system also
allows landlords to manage their properties and tenants online. The system is
developed using the HTML, CSS, JavaScript, PHP, MySQL, Apache2.
Talking about the features of the e-Rental System, the admin can manage
the house by entering details such as house number, features, rent, and status.
In order to add tenants, the user has to enter the full name, gender,
national id, phone number, email, registration date, house, agreement
document, status and exit date. Besides, the admin can add invoices and
payments too. For payment, the user has to select a tenant, paid amount,
balance, date, and comments. Other features include displaying of remaining
payments, recent payments, and collected rents.
Design of this mini-project is pretty simple so that the user won’t find
any difficulties while working on it. House Rental Management System in PHP
helps the user in managing rental records and payments.
main.html
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="main.css">
<script src="homescript.js" defer></script>
<title>DWELL-SPOT</title>
</head>
<body>
<nav class="navbar">
<div class="brand-title">DWELL-SPOT</div>
<a href="#" class="toggle-button">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</a>
<div class="navbar-links">
<ul>
<li><a href="signin.html">Signin/Signup</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="contactus.html">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<form>
<p align ="center">
<input type="search" placeholder="Search Here">
<button type="submit">Search</button>
</p>
</form>
</body>
</html>
main.css
*{
box-sizing: border-box;
}

body {
margin: 0;
padding: 0;
}

.navbar {
display: flex;
position: relative;
justify-content: space-between;
align-items: center;
background-color: #28115d;
color: rgb (255, 255, 255);
opacity: 1.0; /* Apply opacity to the navbar */
}

.brand-title {
font-size: 1.5rem;
margin: .5rem 0rem 0rem 1rem;
}

.navbar-links {
height: 100%;
color: #ffffff;
}

.navbar-links ul {
color:#ffffff;
display: flex;
margin: 0;
padding: 0;
}

.navbar-links li {
color:#ffffff;
list-style: none;
}

.navbar-links li a {
display: block;
text-decoration: none;
color: rgb(250, 250, 250);
padding: 1rem;
opacity: 1.0;
}

.navbar-links li:hover {
background-color: #1f115e;
}

.toggle-button {
position: absolute;
top: .75rem;
right: 1rem;
display: none;
flex-direction: column;
justify-content: space-between;
width: 30px;
height: 21px;
}

.navbar-links li a {
display: block;
text-decoration: none;
color: rgb(250, 250, 250);
padding: 1rem;
opacity: 1.7;
}

.toggle-button .bar{
height: 5px;
width: 100%;
background-color: rgb (35, 22, 72);
border-radius: 10px;
opacity: 0.5;
}

@media (max-width: 800px) {


.navbar {
flex-direction: column;
align-items: flex-start;
}

.toggle-button {
display: flex;
}

.navbar-links {
display: none;
width: 100%;
}

.navbar-links ul {
width: 100%;
flex-direction: column;
}

.navbar-links ul li {
text-align: center;
}
.navbar-links ul li a {
padding: .5rem 1rem;
}

.navbar-links.active {
display: flex;
}
}
form {
color: #030303;
display: contents;
padding: 2px;
border: 1px;
border-radius: 5px;
}
input[type="search"] {
border: 1;
background: transparent;
margin: 1;
padding: 7px 8px;
font-size: 14px;
color: inherit;
border: 1px;
border-radius: inherit;
}
button[type="submit"] {
text-indent: -999px;
overflow: hidden;
width: 40px;
padding: 0;
margin: 1;
border: 1px;
border-radius: inherit;
background: transparent url("data:image/svg+xml,%3Csvg
xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-
search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-
1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-
3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11
0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
cursor: pointer;
opacity: 0.7;
}

button[type="submit"]:hover {
opacity: 1;
}
button[type="submit"]:focus,
input[type="search"]:focus {
box-shadow: 0 0 3px 0 #fbfcfd;
border-color: #26193b;
outline: none;
}
main1.html
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<link rel="stylesheet" href="main.css">
<script src="homescript.js" defer></script>
<title>DWELL-SPOT</title>
</head>
<body>
<nav class="navbar">
<div class="brand-title">DWELL-SPOT</div>
<a href="#" class="toggle-button">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</a>
<div class="navbar-links">
<ul>
<li><a href="properties.html">Properties</a></li>
<li><a href="myprofile.html">My Profile</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="contactus1.html">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<form>
<p align="center">
<input type="search" placeholder="Search Here">
<button type="submit">Search</button>
</p>
</form>
</body>
</html>
main2.html
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<link rel="stylesheet" href="main.css">
<script src="homescript.js" defer></script>
<title>DWELL-SPOT</title>
</head>
<body>
<nav class="navbar">
<div class="brand-title">DWELL-SPOT</div>
<div class="navbar-links">
<ul>
<li><a href="houses.php">Houses</a></li>
<li><a href="myprofile.php">My Profile</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="contactus1.html">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<form>
<p align="center">
<input type="search" placeholder="Search Here">
<button type="submit">Search</button>
</p>
</form>
</body>
</html>
Myprofile.html
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<link rel="stylesheet" href="main.css">
<script src="homescript.js" defer></script>
<title>DWELL-SPOT</title>
</head>
<body>
<nav class="navbar">
<div class="brand-title">DWELL-SPOT</div>
<div class="navbar-links">
<ul>
<li><a href="houses.php">Houses</a></li>
<li><a href="myprofile.php">My Profile</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="contactus1.html">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<form>
<p align="center">
<input type="search" placeholder="Search Here">
<button type="submit">Search</button>
</p>
</form>
</body>
</html>
Myprofile.css
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<link rel="stylesheet" href="main.css">
<script src="homescript.js" defer></script>
<title>DWELL-SPOT</title>
</head>
<body>
<nav class="navbar">
<div class="brand-title">DWELL-SPOT</div>
<div class="navbar-links">
<ul>
<li><a href="houses.php">Houses</a></li>
<li><a href="myprofile.php">My Profile</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="contactus1.html">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<form>
<p align="center">
<input type="search" placeholder="Search Here">
<button type="submit">Search</button>
</p>
</form>
</body>
</html>
Myprofile.css
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}

h1 {
text-align: center;
padding: 0px;
}

.profile-container {
max-width: 400px;
margin: 45px auto;
padding: 20px;
background-color: rgba(255, 255, 255, 0.8);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

p{
margin: 10px 0;
}
button {
background-color: #1babb8;
color: #fff;
border: none;
padding: 10px 20px;
cursor: pointer;
border-radius: 5px;
}

button:hover {
background-color: #1babb8;
}
Myprofile.php
<!DOCTYPE html>
<html>
<head>
<title>My Profile</title>
<link rel="stylesheet" href="myprofile.css">
</head>
<body>
<div class="profile-container">
<?php
session_start();

if (isset($_SESSION['userType'])) {
if ($_SESSION['userType'] === 'user') {
$userData = $_SESSION['userData'];

echo "<h1>Welcome! <br>". $userData['username']."</h1>";


echo "<p>Username: " . $userData['username'] . "</p>";
echo "<p>Phone Number: " . $userData['phno'] . "</p>";
echo "<p>Email: " . $userData['email'] . "</p>";
echo "<p>Role: " . $userData['role'] . "</p>";

echo '<form action="editprofile.php" method="post">';


echo '<button type="submit">Edit Profile</button>';
echo '</form><br>';

echo '<form action="logout.php" method="post">';


echo '<button type="submit">Logout</button>';
echo '</form>';

} elseif ($_SESSION['userType'] === 'owner') {


$ownerData = $_SESSION['ownerData'];
echo "<h1>Welcome! <br>". $ownerData['username']."</h1>";
echo "<p>Username: " . $ownerData['username'] . "</p>";
echo "<p>Phone Number: " . $ownerData['phno'] . "</p>";
echo "<p>Email: " . $ownerData['email'] . "</p>";
echo "<p>Role: " . $ownerData['role'] . "</p>";
echo '<form action="editprofile.php" method="post">';
echo '<button type="submit">Edit Profile</button>';
echo '</form><br>';
echo '<form action="logout.php" method="post">';
echo '<button type="submit">Logout</button>';
echo '</form>';
}
} else {
header("Location: main2.html");
exit();
}
?>
</div>
</body>
</html>

Profile1.php
<?php
session_start();

if (isset($_SESSION['userType'])) {
if ($_SESSION['userType'] === 'user') {
$userData = $_SESSION['userData'];

} elseif ($_SESSION['userType'] === 'owner') {


$ownerData = $_SESSION['ownerData'];

}
} else {

header("Location: dbsignin1.html");
exit();
}
?>

Reset.html
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<title>Password Reset</title>
<link rel="stylesheet" type="text/css" href="reset.css">
</head>
<body>
<div class="container">
<h1>Password Reset</h1>
<form method="post" action="reset.php">
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="New Password"
required>
<input type="password" name="confirm_password" placeholder="Confirm
Password" required>
<div class="options">
<input type="radio" id="userRadio" name="role" value="user">
<label for="userRadio">User/Tenant</label>
<br>
<input type="radio" id="ownerRadio" name="role" value="owner"
required>
<label for="ownerRadio">Owner</label>
<br>
</div>
<input type="submit" name="reset" value="Reset Password">
</div>
</form>
</div>
</body>
</html>
Reset.css

.container {
max-width: 500px;
margin: 50px auto;
padding: 20px;
background-color: #f2eaea;
box-shadow: 0px 0px 10px #999;
}
h1 {
text-align: center;
}

form {
display: flex;
flex-direction: column;
}

input[type="email"],
input[type="password"] {
margin-bottom: 10px;
padding: 10px;
}

input[type="submit"] {
background-color: #11799b;
color: white;
padding: 10px;
border: none;
cursor: pointer;
}

input[type="submit"]:hover {
background-color: #3e8e41;
}

Reset.php
.container {
max-width: 500px;
margin: 50px auto;
padding: 20px;
background-color: #f2eaea;
box-shadow: 0px 0px 10px #999;
}
h1 {
text-align: center;
}

form {
display: flex;
flex-direction: column;
}

input[type="email"],
input[type="password"] {
margin-bottom: 10px;
padding: 10px;
}

input[type="submit"] {
background-color: #11799b;
color: white;
padding: 10px;
border: none;
cursor: pointer;
}

input[type="submit"]:hover {
background-color: #3e8e41;
}

reset1.css
.container {
max-width: 400px;
margin: 45px auto;
padding: 20px;
background-color: rgba(255, 255, 255, 0.8);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
h1 {
text-align: center;
}

form {
display: flex;
flex-direction: column;
}

input[type="email"],
input[type="password"] {
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 20px;
}

input[type="submit"] {
padding: 10px;
background-color: #11799b;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

input[type="submit"]:hover {
background-color: #3e8e41;
}

Signin.html
<!DOCTYPE html>
<html lang="en">
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<title>DWELL-SPOT/Signin</title>
<link rel="stylesheet" href="signin.css">
</head>
<body>
<main>
<div class="container">
<h1>Sign In</h1>
<form method="POST" action="dbsignin.php">
<label for="Name">UserName</label>
<input type="text" name="username"
placeholder="Name" required>
<label for="phno">Phone Number</label>
<input type="phno" name="phno"
placeholder="PhoneNumber" required>
<label for="password">Password</label>
<input type="password" name="password"
placeholder="Password" required>
<a href="reset.html">Forgot Password?</a><br>
<div class="options">
<input type="radio" id="userRadio" name="role"
value="user">
<label for="userRadio">User/Tenant</label>
<br>
<input type="radio" id="ownerRadio" name="role"
value="owner" required>
<label for="ownerRadio">Owner</label>
</div>
<br>
<input type="submit" value="Sign In">
<center><br>Don't have an account <a href="signup.html">
sing up</a></center>
</form>
</main>
</div>
</body>
</html>

Signin.css

.container {
max-width: 500px;
margin: 50px auto;
padding: 20px;
background-color: #f2eaea;
box-shadow: 0px 0px 10px #999;
}

h1 {
text-align: center;
margin-bottom: 20px;
}

form {
display: flex;
flex-direction: column;
}

label {
margin-bottom: 10px;
font-weight: bold;
}

input[type="text"],
input[type="password"] {
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 20px;
}

input[type="submit"] {
padding: 10px;
background-color: #11799b;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

input[type="submit"]:hover {
background-color: #3e8e41;
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
background-color: white;
margin: 15% auto;
padding: 20px;
border-radius: 5px;
width: 50%;
text-align: center;
position: relative;
}

.close {
position: absolute;
top: 0;
right: 5px;
font-size: 20px;
font-weight: bold;
cursor: pointer;
}

Dbsignin.php
<?php
$con = new mysqli("dwellspot", "root", "root", "dwellspot");
if ($con->connect_error) {
die("Failed to connect to MYSQL: " . $con->connect_errno);
}

$username = $_POST['username'];
$password = $_POST["password"];
$phno = $_POST['phno']
$role = $_POST['role'];

if ($role === 'user') {


$sql = "SELECT * FROM users WHERE username='$username' AND
password='$password' AND role='$role' AND phno='$phno'";
} else {
$sql = "SELECT * FROM owners WHERE username='$username' AND
password='$password' AND role='$role' AND phno='$phno'";
}
$result = $con->query($sql);
if ($result) {
if ($result->num_rows > 0) {
include 'main1.html';
echo "";
} else {
include 'signin.html';
echo '<script>alert("Invalid Password!")</script>';
}
} else {
//include 'signin.html';
echo '<script>alert("Invalid Password!")</script>';
}
//include 'signin.html';
// $con->goto('signin.html');
?>

Signup.html
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img.jpeg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<head>
<title>DWELL-SPOT/Sign Up</title>
<link rel="stylesheet" type="text/css" href="signup.css">
</head>
<body>
<div class="container">
<h1>Sign Up</h1>
<form method="POST" action="dbsignup.php">
<label for="Name">UserName</label>
<input type="text" name="username" placeholder="Name"
required>
<label for="mail">Email</label>
<input type="email" name="mail" placeholder="Email"
required>
<label for="password">Password</label>
<input type="phno" name="phno"
placeholder="PhoneNumber" required>
<label for="phno">Phone Number</label>
<input type="password" name="password"
placeholder="Password" required>
<label for="confirm-password">Confirm Password</label>
<input type="password" name="confirm-password"
placeholder="Confirm Password" required>
<div class="options">
<input type="radio" id="userRadio" name="role"
value="user">
<label for="userRadio">User/Tenant</label>
<br>
<input type="radio" id="ownerRadio" name="role"
value="owner">
<label for="ownerRadio">Owner</label>
</div>
<input type="submit" value="Sign Up">
</form>
</div>
</body>
</html>

Signup.css
.container {
max-width: 400px;
margin: 50px auto;
padding: 20px;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

h1 {
color: #333;
}

.options {
margin-bottom: 20px;
}

.btn {
display: inline-block;
padding: 10px 20px;
margin: 10px;
border-radius: 5px;
background-color: #11799b;
color: #fff;
text-decoration: none;
transition: background-color 0.3s;
}

.btn:hover {
background-color: #11799b;
}

body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-image: url('img.jpg');
background-repeat: no-repeat;
background-size: cover;
}
.container {
max-width: 500px;
margin: 50px auto;
padding: 20px;
background-color: #f2eaea;
box-shadow: 0px 0px 10px #999;
}

h1 {
text-align: center;
margin-bottom: 20px;
}

form {
display: flex;
flex-direction: column;
}

label {
margin-bottom: 10px;
font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"] {
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 20px;
}

input[type="submit"] {
padding: 10px;
margin-top: 10px;
background-color: #11799b;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

button:hover {
background-color: #11799b;
}

Dbsignup.php
<?php
include 'dbcon.php';
session_start();

if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST['username'];
$password = $_POST["password"];
$role = $_POST['role'];
$email = $_POST['email'];
$phno = $_POST['phno'];

if ($role === 'user' || $role === 'owner') {


$sql = "INSERT INTO " . ($role === 'user' ? 'users' : 'owners') . "
(username, email, password, phno, role) VALUES ('$username', '$email',
'$password', '$phno', '$role')";

if ($con->query($sql) === true) {


// Set session variables
if ($role === 'user') {
$_SESSION['userData'] = [
'username' => $username,
'phno' => $phno,
'email' => $email,
'role' => $role
];
$_SESSION['userType'] = 'user';
} elseif ($role === 'owner') {
$_SESSION['ownerData'] = [
'username' => $username,
'phno' => $phno,
'email' => $email,
'role' => $role
];
$_SESSION['userType'] = 'owner';
}

// Redirect to the profile page


echo '<script>alert("Successfully Signedup!")</script>';
header("Location: main2.html");
exit();
} else {
echo '<script>alert("UserName/Mail not available!")</alert>';
}
} else {
echo "Invalid role.";
}
}
?>
Updateprofile.php
<?php
session_start();

if (!isset($_SESSION['user_id'])) {
header("Location: login.html"); // Redirect to login page if not logged
in
exit();
}

// Connect to your database


$servername = "dwellspot";
$username = "root";
$password = "root";
$dbname = "dwellspot";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// Retrieve updated user information from the form


$name = $_POST['name'];
$email = $_POST['email'];

$phno = $_SESSION['phno'];
$role = $_SESSION['role'];
// Update the user's profile information based on the user type
if ($userType == "user") {
$query = "UPDATE users SET username='$name', email='$email'
WHERE phno='$phno'";
} elseif ($userType == "owner") {
$query = "UPDATE owners SET username='$name', email='$email'
WHERE phno='$phno'";
}

if ($conn->query($query) === TRUE) {


$_SESSION['username'] = $name; // Update the session with the new
name
$_SESSION['email'] = $email; // Update the session with the new
email
header("Location: myprofile.php?success=1");
} else {
echo "Error updating profile: " . $conn->error;
}

$conn->close();
?>

You might also like