Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Advanced Web Application Development REG NO: 20X51A05A0

Task: Design and develop a User Authentication System (Login-Logout functionality)


using cookies, sessions, JWT, and SMS API. Also, identify which is suitable for your
application

III-I CSE SREC, Nandyal Page: 179


Advanced Web Application Development REG NO: 20X51A05A0

Module 7
Task: Develop Add Student Profile Page to store data into the database and develop a
webpage to retrieve the student details based on the Roll Number or any unique ID.
<!DOCTYPE html>
<html lang="en">
<head>
<title>retrieve data from database</title>
</head>
<body>
<form action="" method="GET">
Enter ID<input type="text" name="id" value="<?php if(isset($_GET['id'])){echo $_GET['id'];} ?>" >

<button type="submit">Search</button>
//<input type="submit" value="search">
</form>

<?php
$con = mysqli_connect("localhost","root","","20x51a0562");
if(isset($_GET['id']))
{
$id = $_GET['id'];
$query = "SELECT * FROM student WHERE id='$id' ";
$query_run = mysqli_query($con, $query);
if(mysqli_num_rows($query_run) > 0)
{
foreach($query_run as $row)
{
?>
<label for="">Name</label>
<input type="text" value="<?= $row['Name']; ?>" >

<label for="">Phone Number</label>


<input type="text" value="<?= $row['Phone']; ?>" >

<label for="">Email</label>
<input type="text" value="<?= $row['Email']; ?>" >
<label for="">Address</label>
<input type="text" value="<?= $row['Address']; ?>" >

<?php
}
}
else
{

III-I CSE SREC, Nandyal Page: 165


Advanced Web Application Development REG NO: 20X51A05A0
echo "No Record Found";
}
}
Type your text
?>

</body>
</html>

III-I CSE SREC, Nandyal Page: 166

You might also like