book a seat and move to user histoy page and see his booked seats . is this a good way ? what should i do , i do not know :( (airline seat reservation)

<?php
session_start();
    if(!isset($_COOKIE['loggedin'])){
        header("location:index.php");   
    }

    ?>
<html>
<head>
<title><?php echo $_SESSION['user'];?></title>
<style type="text/css">
h5 {
    position: absolute;
    background:yellow;
    color: blue;
    width: 976px;
    height: 247px;
    left: 80px;
    top: 170px;
}
</style>
</head>
<body>
<form name="" action="history.php" method="POST">
<h1 style="text-align:center">Wellcome</h1>
<a href="logout.php"><p style="text-align:right">Logout</p></a>
<h5><table border='1'>
<tr>
<th>Name</th>
<th>Departure City</th>
<th>Arrival City</th>
<th>Departure Time</th>
<th>Price</th>
<th>Is Reserve</th>
</tr>
<tr>
<td><input type="text" name="n" value="PIA" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Hyderabad" readonly></td>
<td><input type="text" name="dt" value="3:00PM" readonly></td>
<td><input type="text" name="p" value="5000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Airblue" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Islamabad" readonly></td>
<td><input type="text" name="dt" value="12:00PM" readonly></td>
<td><input type="text" name="p" value="6000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Airindus" readonly></td>
<td><input type="text" name="dp" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Lahore" readonly></td>
<td><input type="text" name="dt" value="4:00PM" readonly></td>
<td><input type="text" name="p" value="7000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Shaheen Air" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Peshawar" readonly></td>
<td><input type="text" name="dt" value="5:00PM" readonly></td>
<td><input type="text" name="p" value="8000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Aero Asia" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Faislabad" readonly></td>
<td><input type="text" name="dt" value="11:00AM" readonly></td>
<td><input type="text" name="p" value="9000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Hajvairy" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Multan" readonly></td>
<td><input type="text" name="dt" value="9:00PM" readonly></td>
<td><input type="text" name="p" value="12000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Bhoja Air" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Rahimyarkhan" readonly></td>
<td><input type="text" name="dt" value="11:00PM" readonly></td>
<td><input type="text" name="p" value="10000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
<tr>
<td><input type="text" name="n" value="Pak Airways" readonly></td>
<td><input type="text" name="dc" value="Karachi" readonly></td>
<td><input type="text" name="ac" value="Queta" readonly></td>
<td><input type="text" name="dt" value="9:00PM" readonly></td>
<td><input type="text" name="p" value="11000" readonly></td>
<td><input type="submit" name="sub" value="reserve"></td>
</tr>
</h5>
</form>
</body>
</html>

I guess you can store the them in session as an array.However, before doing so, you need to fix your form first.

how can i fix a form

Does the list of flight have to be hard coded? I thought you need to read the data from somewhere instead of hard code them this way???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.