You are on page 1of 32

VEER NARMAD SOUTH GUJARAT UNIVERSITY, SURAT.

Third Year
Bachelor of Computer Application (T.Y.B.C.A.)

Semester - V

Vimal Tormal Poddar BCA College


Pandesara, Surat.

File Submission
506: Practical of Web Framework
and Services
YEAR: 2022-23

Submitted by

Roll No : 45
Name : Harsh J. Mendapara

Submitted To
Prof. Pinal Solanki
VIMAL TORMAL PODDAR BCA COLLEGE

BACHELOR
OF
COMPUTER APPLICATION

B.C.A

Certificate

This is to certify that Mr. / Ms. Harsh J Mendapara Seat


no.2020028970 has satisfactorily completed his / her software computer
Practical Work in PAPER No. 504-Web Framework and Services for the
SEMESTER- 5 during the academic year 2022-2023.

Date :_05/09/2022 _________________


Teacher-In-Charge
INDEX

Page
Sr. No Date Query Sign.
No.
Q1 05-09-2022 Create a web page using PHP which 1
accept item informationlike item To
name, item type, andquantity from 5
the customer which gives the facility
of placing the order. Also give
facility of displaying order
according to order no.
Q2 05-09-2022 Create a web page using PHP which 6
accept ticket booking information like To
client_name, source, destination, 9
address, nos. Of passenger travelling,
travelling date and train number. Store
these records using mySQLdatabase.
Provide insert and
navigation options.
Q3 05-09-2022 Create a web page using PHP which 10
accepts student information like roll To
no, name,age, city and 13
phone_number.
Store these records in mySQL
database. Provide insert, updateby roll
no. & view options.

Q4 05-09-2022 Create web pages which accept book 14


details like book_code, book_name, To
author_name, cost, ISBN_No. Create 18
database and provide facility to
updating bookby book_code and
searching by
book_name and author_name
Q5 05-09-2022 Create a website for online mobile 19
shopping of different companies. This To
website displaysdifferent mobiles with 22
their prices. (Company, Model Name,
price, etc.) Admin can add or remove
mobiles. Customer can search mobile
according to price.
Also provide proper validations.

Q6 05-09-2022 Create a web page for AMAZON


that gives order details and status 23
Tp
of order according to the order no. 23
given by customer. Give
appropriate validations. Also give
facility for viewing past orders by
date. (Tables : cust_mast,
item_mast, order_mast,
order_detail)

Q7 05-09-2022 Create a registration page for 23


matrimony website with all required To
validations. Fields arelike 28
person_name, city, mobno,cast,
subcast, gender, qualification, etc.
Also give facility of searching records
by
city and cast. Use concept ofsession.

Q8 05-09-2022 Create a website for particular 28


hotel. Customer can book rooms TO
28
using this website and also view
status of available rooms. Admin
can add room detail in this
website. (Tables: Room_Mast,
Booking, Cust_Mast)
504-Web Framework and Services

Config.php file

Q1) . Create a web page using PHP which accept item information like item name,
item type, and quantity from the customer which gives the facility of placing the
order. Also give facility of displaying order according to order no.

<?php
include("config.php");
?>
<html>

<head>
<title> Question - 1 </title>
</head>

<body>
<center>
<h1> Question - 1</h1>
<form name="form" method="POST" action="">
<table>
<tr>
<td> Enter Order No :- :- </td>
<td>
<input type="number" name="orderno" placeholder="Order No">
</td>

45-Harsh Mendapara Page 1


504-Web Framework and Services

</tr>
<tr>
<td> Enter Item Name :- :- </td>
<td>
<input type="text" name="name" placeholder="Item Name">
</td>
</tr>
<tr>
<td> Enter Item Type :- </td>
<td>
<input type="text" name="type" placeholder="Item Type">
</td>
</tr>
<tr>
<td> Enter Item Quantity :- </td>
<td>
<input type="number" name="qty" placeholder="Item Quantity">
</td>
</tr>
</table>
<table>
<tr>
<br>
<td>
<input type="submit" name="insert" value="Place Order">
<input type="submit" name="update" value="Update Order">
<input type="submit" name="delete" value="Delete Order">
<input type="submit" name="search" value="Search Order">
<input type="submit" name="display" value="Display Order">
</td>
</tr>
</table>
</form>
<br>
<table border="1">
<tr>
<th>Order No</th>
<th>Order Name</th>

45-Harsh Mendapara Page 2


504-Web Framework and Services

<th>Order Type</th>
<th>Order Quantity</th>
</tr>
<?php
//searching functionality
if (isset($_POST["search"])) {
$on = $_POST["orderno"];
$res = mysqli_query($con, "select * from orderlist where orderno ='$on'");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["orderno"];
echo "</td>";
echo "<td>";
echo $row["ordername"];
echo "</td>";
echo "<td>";
echo $row["ordertype"];
echo "</td>";
echo "<td>";
echo $row["orderquantity"];
echo "</td>";
echo "</tr>";
}
}
//displaying functionality
if (isset($_POST["display"])) {
$res = mysqli_query($con, "select * from orderlist order by orderno");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["orderno"];
echo "</td>";
echo "<td>";
echo $row["ordername"];
echo "</td>";
echo "<td>";
echo $row["ordertype"];

45-Harsh Mendapara Page 3


504-Web Framework and Services

echo "</td>";
echo "<td>";
echo $row["orderquantity"];
echo "</td>";
echo "</tr>";
}
}
//insert functionality
if (isset($_POST["insert"])) {
$on = $_POST["orderno"];
$rn = $_POST["name"];
$ty = $_POST["type"];
$qy = $_POST["qty"];

if ($on != "" && $rn != "" && $ty != "" && $qy != "") {
$querry = "insert into orderlist values('$on','$rn','$ty','$qy')";
mysqli_query($con, $querry);
}
}
//update functionality
if (isset($_POST["update"])) {
$on = $_POST["orderno"];
$rn = $_POST["name"];
$ty = $_POST["type"];
$qy = $_POST["qty"];

if ($on != "" && $rn != "" && $ty != "" && $qy != "") {
$querry = "update orderlist set orderno='$on' , name='$rn',type='$ty',qty='$qy'
where orderno='$on'";
mysqli_query($con, $querry);
}
}
//delete functionality
if (isset($_POST["delete"])) {
$on = $_POST["orderno"];
$rn = $_POST["name"];
$ty = $_POST["type"];
$qy = $_POST["qty"];

45-Harsh Mendapara Page 4


504-Web Framework and Services

$querry = "delete from orderlist where orderno='$_POST[orderno]'";


mysqli_query($con, $querry);
}

?>

</table>
</center>
</body>

</html>

45-Harsh Mendapara Page 5


504-Web Framework and Services

Q2). Create a web page using PHP which accept ticket booking information like
client_name, source, destination, address, nos. Of passenger travelling, travelling
date and train number. Store these records using mySQL database. Provide insert
and navigation options.

<?php
include("config.php");
?>
<html>

<head>
<title>
Question - 2
</title>

<link href="./StyleSheet1.css" rel="stylesheet" />


</head>

<body>
<center>
<h1> Question - 2</h1>
<form name="form" method="POST" action="">
<table>

45-Harsh Mendapara Page 6


504-Web Framework and Services

<tr>
<td> Enter Id :- :- </td>
<td> <input type="number" name="id" placeholder="Id"></td>

</tr>
<tr>
<td> Enter Client Name :- </td>
<td> <input type="text" name="clientname" placeholder="Client Name"></td>
</tr>
<tr>
<td> Enter Source :- </td>
<td> <input type="text" name="source" placeholder="Source"></td>
</tr>
<tr>
<td> Enter Destination :- </td>
<td> <input type="text" name="destination" placeholder="Destination"></td>
</tr>
<tr>
<td> Enter Address :- </td>
<td> <textarea name="address" placeholder="Enter Address" rows="5" cols="15">
</textarea>
</td>
</tr>
<tr>
<td> Enter No of Passenger Travelling :- </td>
<td> <input type="number" name="no_of_passen" placeholder="Enter No of
Passenger Travelling"></td>
</tr>

<tr>
<td> Enter Travelling Date :- </td>
<td> <input type="date" name="travellingdate" placeholder="travelling date">
</td>
</tr>
<tr>
<td> Enter vehicle Number :- </td>
<td> <input type="number" name="vehicleno" placeholder="vehicle number">
</td>

45-Harsh Mendapara Page 7


504-Web Framework and Services

</tr>
</table>
<table>
<tr>
<br>
<td> <input class="btn1" type="submit" name="insert" value="Insert">
</td>
</tr>
</table>
</form>
<br>
<table border="1">
<tr>
<th>Id</th>
<th>Client Name</th>
<th>Source</th>
<th>Destination</th>
<th>Address</th>
<th>No of Passenger Travelling</th>
<th>Travelling Date</th>
<th>vehicle Number</th>
</tr>
<?php
$res = mysqli_query($con, "select * from travel_agent");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["id"];
echo "</td>";
echo "<td>";
echo $row["clientname"];
echo "</td>";
echo "<td>";
echo $row["source"];
echo "</td>";
echo "<td>";
echo $row["destination"];
echo "</td>";

45-Harsh Mendapara Page 8


504-Web Framework and Services

echo "<td>";
echo $row["address"];
echo "</td>";
echo "<td>";
echo $row["no_of_passen"];
echo "</td>";
echo "<td>";
echo $row["travellingdate"];
echo "</td>";
echo "<td>";
echo $row["vehicleno"];
echo "</td>";
echo "</tr>";
}
if (isset($_POST['insert'])) {
$id = $_POST['id'];
$clientname = $_POST['clientname'];
$source = $_POST['source'];
$destination = $_POST['destination'];
$address = $_POST['address'];
$no_of_passen = $_POST['no_of_passen'];
$travellingdate = $_POST['travellingdate'];
$vehicleno = $_POST['vehicleno'];

if ($id != "" && $clientname != "" && $source != "" && $destination != "" && $address
!= "" && $no_of_passen != "" && $travellingdate != "" && $vehicleno != "") {
$querry = "insert into travel_agent
values('$id','$clientname','$source','$destination','$address','$no_of_passen','$travellingdate','
$vehicleno')";
mysqli_query($con, $querry);
}
}
?>
</table>
</center>
</body>

</html>

45-Harsh Mendapara Page 9


504-Web Framework and Services

Q3. Create a web page using PHP which accepts student information like roll no,
name, age, city and phone_number. Store these records in mySQL database.
Provide insert, update by roll no. & view options.

<?php
include("config.php");
?>

<html>

<head>
<title>
Question - 3

</title>

<link href="./StyleSheet1.css" rel="stylesheet" />


</head>

<body>
<center>
<h1> Question - 3</h1>
<form name="form" method="POST" action="">

45-Harsh Mendapara Page 10


504-Web Framework and Services

<table>
<tr>
<td> Enter Roll No :- :- </td>
<td> <input type="number" name="roll" placeholder="Roll No"></td>
</tr>
<tr>
<td> Enter Name :- :- </td>
<td> <input type="text" name="name" placeholder="Name"></t d>
</tr>
<tr>
<td> Enter Age :- </td>
<td> <input type="number" name="age" placeholder="Age"></t d>
</tr>
<tr>
<td> Enter City :- </td>
<td> <input type="text" name="city" placeholder="City"></t d>
</tr>
<tr>
<td> Enter Mobile No :- </td>
<td> <input type="number" name="mobile" placeholder="MObile Number"></td>
</tr>
</table>
<table>
<tr>

<br>
<td> <input type="submit" class="btn1" name="insert" value="Insert">
<input type="submit" class="btn1" name="update" value="Update">
<input type="submit" class="btn1" name="display" value="Display">
</td>
</tr>
</table>
</form>
<br>
<table border="1">
<tr>
<th>Roll</th>
<th>Name</th>

45-Harsh Mendapara Page 11


504-Web Framework and Services

<th>Age</th>
<th>City</th>
<th>Mobile NUmber</th>
</tr>
<?php
if (isset($_POST['display'])) {
$res = mysqli_query($con, "select * from stud_info");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["roll"];
echo "</td>";
echo "<td>";
echo $row["name"];
echo "</td>";
echo "<td>";
echo $row["age"];
echo "</td>";
echo "<td>";
echo $row["city"];
echo "</td>";
echo "<td>";
echo $row["mobile"];
echo "</td>";
echo "</tr>";
}
}
if (isset($_POST['insert'])) {
$roll = $_POST['roll'];
$name = $_POST['name'];
$age = $_POST['age'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];

if (
$roll != "" && $name != "" && $age != "" && $city != "" && $mobile != ""
){
$querry = "insert into stud_info values('$roll','$name','$age','$city','$mobile')";

45-Harsh Mendapara Page 12


504-Web Framework and Services

mysqli_query($con, $querry);
}
}
if (isset($_POST['update'])) {
$roll = $_POST['roll'];
$name = $_POST['name'];
$age = $_POST['age'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];

if (
$roll != "" && $name != "" && $age != "" && $city != "" && $mobile != ""
){
$querry = "update stud_info set roll='$roll' ,
name='$name',age='$age',city='$city',mobile='$mobile' where roll='$roll'";
mysqli_query($con, $querry);
}
}
?>
</table>
</center>
</body>

</html>

45-Harsh Mendapara Page 13


504-Web Framework and Services

Q4. Create web pages which accept book details like book_code, book_name,
author_name, cost, ISBN_No. Create database and provide facility to updating
book by book_code and searching by book_name and author_name.

<?php
include("config.php");
?>
<html>

<head>
<title>
Question - 4
</title>

<link href="./StyleSheet1.css" rel="stylesheet" />


</head>

<body>
<center>
<h1> Question - 4</h1>
<form name="form" method="POST" action="">
<table>
<tr>

45-Harsh Mendapara Page 14


504-Web Framework and Services

<td> Enter Book Code :- :- </td>


<td> <input type="number" name="bookcode" placeholder="Book Code"></td>
</tr>
<tr>
<td> Enter Book Name :- :- </td>
<td> <input type="text" name="bookname" placeholder="BookName"></td>
</tr>
<tr>
<td> Enter Author Name :- </td>
<td> <input type="text" name="authorname" placeholder="Author Name"></td>
</tr>
<tr>
<td> Enter Cost :- </td>
<td> <input type="number" name="cost" placeholder="Cost"></td>
</tr>
<tr>
<td> Enter Isbn No :- </td>
<td> <input type="number" name="isbnno" placeholder="IsbnNo"></td>
</tr>
</table>
<table>
<tr>
<br>
<td> <input type="submit" class="btn1" name="insert" value="Insert">
<input type="submit" class="btn1" name="update" value="Update">
<input type="submit" class="btn1" name="search" value="Search">
<input type="submit" class="btn1" name="display" value="Display">
</td>
</tr>

</table>
</form>
<br>
<table border="1">
<tr>
<th>Book Code</th>
<th>Book Name</th>
<th>Author Name</th>

45-Harsh Mendapara Page 15


504-Web Framework and Services

<th>Cost</th>
<th>Isbn No</th>
</tr>
<?php
if (isset($_POST['display'])) {
$res = mysqli_query($con, "select * from book_data");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["bookcode"];
echo "</td>";
echo "<td>";
echo $row["bookname"];
echo "</td>";
echo "<td>";
echo $row["authorname"];
echo "</td>";
echo "<td>";
echo $row["cost"];
echo "</td>";
echo "<td>";
echo $row["isbnno"];
echo "</td>";
echo "</tr>";
}
}
if (isset($_POST['search'])) {
$bookcode = $_POST['bookcode'];
$bookname = $_POST['bookname'];
$authorname = $_POST['authorname'];
$cost = $_POST['cost'];
$isbnno = $_POST['isbnno'];
$res = mysqli_query($con, "select * from book_data where bookcode='$bookcode' ||
authorname='$authorname'");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["bookcode"];

45-Harsh Mendapara Page 16


504-Web Framework and Services

echo "</td>";
echo "<td>";
echo $row["bookname"];
echo "</td>";
echo "<td>";
echo $row["authorname"];
echo "</td>";
echo "<td>";
echo $row["cost"];
echo "</td>";
echo "<td>";
echo $row["isbnno"];
echo "</td>";
echo "</tr>";
}
}
// else {
// $res = mysqli_query($con, "select * from book_data");
// while ($row = mysqli_fetch_array($res)) {
// echo "<tr>";
// echo "<td>";
// echo $row["bookcode"];
// echo "</td>";
// echo "<td>";
// echo $row["bookname"];
// echo "</td>";
// echo "<td>";
// echo $row["authorname"];
// echo "</td>";

// echo "<td>";
// echo $row["cost"];
// echo "</td>";
// echo "<td>";
// echo $row["isbnno"];
// echo "</td>";
// echo "</tr>";
// }

45-Harsh Mendapara Page 17


504-Web Framework and Services

// }
if (isset($_POST['insert'])) {
$bookcode = $_POST['bookcode'];
$bookname = $_POST['bookname'];
$authorname = $_POST['authorname'];
$cost = $_POST['cost'];
$isbnno = $_POST['isbnno'];

if ($bookcode != "" && $bookname != "" && $authorname != "" && $cost != "" &&
$isbnno != "") {
$querry = "insert into book_data
values('$bookcode','$bookname','$authorname','$cost','$isbnno')";
mysqli_query($con, $querry);
}
}
if (isset($_POST['update'])) {
$bookcode = $_POST['bookcode'];
$bookname = $_POST['bookname'];
$authorname = $_POST['authorname'];
$cost = $_POST['cost'];
$isbnno = $_POST['isbnno'];
if ($bookcode != "" && $bookname != "" && $authorname != "" && $cost != "" &&
$isbnno != "") {
$querry = "update book_data set bookcode='$bookcode' ,
bookname='$bookname',authorname='$authorname',cost='$cost',isbnno='$isbnno' where
bookcode='$bookcode'";
mysqli_query($con, $querry);
}
}
?>
</table>
</center>
</body>

</html>

45-Harsh Mendapara Page 18


504-Web Framework and Services

Q5. Create a website for online mobile shopping of different companies. This
website displays different mobiles with their prices. (Company, Model Name,
price, etc.) Admin can add or remove mobiles. Customer can search mobile
according to price. Also provide proper validations.

<?php
include("config.php");
?>
<html>

<head>
<title>
Question - 5
</title>

<link href="./StyleSheet1.css" rel="stylesheet" />


</head>

<body>
<center>
<h1> Question - 5</h1>
<form name="form" method="POST" action="">
<table>

45-Harsh Mendapara Page 19


504-Web Framework and Services

<tr>
<td> Enter Mobile id :- :- </td>
<td> <input type="number" name="mob_id" placeholder="Mobile Id"></td>
</tr>
<tr>
<td> Enter Company Name :- :- </td>
<td> <input type="text" name="company" placeholder="Company"></td>

</tr>
<tr>
<td> Enter Model Name :- </td>
<td> <input type="text" name="model" placeholder="Model"></td>
</tr>
<tr>
<td> Enter price :- </td>
<td> <input type="number" name="price" placeholder="Price"></td>
</tr>
</table>
<table>
<tr>
<br>
<td> <input type="submit" class="btn1" name="insert" value="Insert">
<input type="submit" class="btn1" name="delete" value="Delete">
<input type="submit" class="btn1" name="search" value="Search">
</td>
</tr>
</table>
</form>
<br>
<table border="1">
<tr>
<th>No of Product</th>
<th>Company Name</th>

<th>Model Name</th>
<th>Price</th>
</tr>
<?php

45-Harsh Mendapara Page 20


504-Web Framework and Services

if (isset($_POST['search'])) {
$price = $_POST['price'];
$res = mysqli_query($con, "select * from mobile_shop where price = '$price'");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["mob_id"];
echo "</td>";
echo "<td>";
echo $row["company"];
echo "</td>";
echo "<td>";
echo $row["model"];
echo "</td>";
echo "<td>";
echo $row["price"];
echo "</td>";
echo "</tr>";
}
} else
$res = mysqli_query($con, "select * from mobile_shop");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["mob_id"];
echo "</td>";
echo "<td>";
echo $row["company"];
echo "</td>";

echo "<td>";
echo $row["model"];
echo "</td>";
echo "<td>";
echo $row["price"];
echo "</td>";
echo "</tr>";
}

45-Harsh Mendapara Page 21


504-Web Framework and Services

if (isset($_POST['insert'])) {
$mob_id = $_POST['mob_id'];
$company = $_POST['company'];
$model = $_POST['model'];
$price = $_POST['price'];

if ($mob_id != "" && $company != "" && $model != "" && $price != "") {
$querry = "insert into mobile_shop values('$mob_id','$company','$model','$price')";
mysqli_query($con, $querry);
}
}
if (isset($_POST['delete'])) {
$mob_id = $_POST['mob_id'];
$company = $_POST['company'];
$model = $_POST['model'];

$price = $_POST['price'];

$querry = "delete from mobile_shop where mob_id = '$mob_id'";


mysqli_query($con, $querry);
}
?>
</table>
</center>
</body>

</html>

45-Harsh Mendapara Page 22


504-Web Framework and Services

Q6. Create a web page for AMAZON that gives order details and status of order
according to the order no. given by customer. Give appropriate validations. Also
give facility for viewing past orders by date. (Tables : cust_mast, item_mast,
order_mast, order_detail)

Q7. Create a registration page for matrimony website with all required
validations. Fields are like person_name, city, mobno, cast, subcast, gender,
qualification, etc. Also give facility of searching records by city and cast. Use
concept of session.

<?php
include("config.php");
session_start();
if (isset($_POST['insert'])) {
$personname = $_POST['personname'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];
$cast = $_POST['cast'];
$subcast = $_POST['subcast'];
$gender = $_POST['gender'];
$qualification = $_POST['qualification'];

45-Harsh Mendapara Page 23


504-Web Framework and Services

$_SESSION['personname'] = $personname;
$_SESSION['city'] = $city;
$_SESSION['mobile'] = $mobile;
$_SESSION['cast'] = $cast;
$_SESSION['subcast'] = $subcast;
$_SESSION['gender'] = $gender;
$_SESSION['qualification'] = $qualification;
}
?>
<html>

<head>
<title>
Question - 7
</title>

<link href="./StyleSheet1.css" rel="stylesheet" />


</head>

<body>
<center>
<h1> Question - 7</h1>
<form name="form" method="POST" action="">
<table>
<tr>
<td> Enter Person Name :- :- </td>
<td> <input type="text" name="personname" placeholder="person Name"></t d>
</tr>
<tr>
<td> Enter City :- :- </td>
<td> <input type="text" name="city" placeholder="City"></td>
</tr>

<tr>
<td> Enter Mobile Number :- </td>
<td> <input type="number" name="mobile" placeholder="Mobile Number"></ td>
</tr>
<tr>

45-Harsh Mendapara Page 24


504-Web Framework and Services

<td> Enter Cast :- </td>


<td> <input type="text" name="cast" placeholder="Cast"></td>
</tr>
<tr>
<td> Enter Sub Cast :- </td>
<td> <input type="text" name="subcast" placeholder="Sub Cast"></td>
</tr>
<tr>
<td> Enter Gender :- </td>
<td> <input type="text" name="gender" placeholder="Gender"></td>
</tr>
<tr>
<td> Enter Qualification :- </td>
<td> <input type="text" name="qualification" placeholder="Qualification"></t d>
</tr>
</table>
<table>

<tr>
<br>
<td> <input type="submit" class="btn1" name="insert" value="Insert">
<input type="submit" class="btn1" name="search" value="Search">
</td>
</tr>
</table>
</form>
<br>
<table border="1">
<tr>
<th>Person Name</th>
<th>City</th>
<th>Mobie Number</th>
<th>Cast</th>
<th>Sub Cast</th>
<th>Gender</th>
<th>Qualification</th>
</tr>
<?php

45-Harsh Mendapara Page 25


504-Web Framework and Services

if (isset($_POST['search'])) {
$city = $_POST['city'];
$cast = $_POST['cast'];

$res = mysqli_query($con, "select * from matrimony where city = '$city' ||


cast='$cast'");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["personname"];
echo "</td>";
echo "<td>";
echo $row["city"];
echo "</td>";
echo "<td>";
echo $row["mobile"];
echo "</td>";
echo "<td>";
echo $row["cast"];
echo "</td>";
echo "<td>";
echo $row["subcast"];
echo "</td>";
echo "<td>";
echo $row["gender"];
echo "</td>";
echo "<td>";
echo $row["qualification"];
echo "</td>";
echo "</tr>";
}
} else {
$res = mysqli_query($con, "select * from matrimony");
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
echo $row["personname"];
echo "</td>";

45-Harsh Mendapara Page 26


504-Web Framework and Services

echo "<td>";
echo $row["city"];
echo "</td>";
echo "<td>";
echo $row["mobile"];
echo "</td>";
echo "<td>";
echo $row["cast"];
echo "</td>";
echo "<td>";
echo $row["subcast"];
echo "</td>";

echo "<td>";
echo $row["gender"];
echo "</td>";
echo "<td>";
echo $row["qualification"];
echo "</td>";
echo "</tr>";
}
}
if (isset($_POST['insert'])) {
$personname = $_POST['personname'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];
$cast = $_POST['cast'];
$subcast = $_POST['subcast'];
$gender = $_POST['gender'];
$qualification = $_POST['qualification'];

if ($personname != "" && $city != "" && $mobile != "" && $cast != "" && $subcast != ""
&& $gender != "" && $qualification != "") {
// $querry = "insert into matrimony
values('0','$personname','$city','$mobile','$cast','$subcast','$gender','$qualification')";
$querry = "INSERT INTO matrimony (id, personname, city, mobile, cast, subcast,
gender, qualification) VALUES
('0','$personname','$city','$mobile','$cast','$subcast','$gender','$qualification')";

45-Harsh Mendapara Page 27


504-Web Framework and Services

mysqli_query($con, $querry);
}
}

?>
</table>
</center>
</body>

</html>

45-Harsh Mendapara Page 28

You might also like