
January 12th, 2013, 12:11 AM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
Well that's interesting.
Quote: | Originally Posted by psonawane well am sorry i'm totally new here so never knew this. 
any way here u go
PHP Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body background="media/dark_blue_background-wallpaper-1920x1200.jpg">
<center>
<?php
session_start();
if ($_SESSION['uname']) {
?>
<div id="bus">
<p><img src="media/rk_logo2.png" height="100" width="220"></p>
<ul>
<li style="float: right; padding-right: 10px; font-family: sans-serif; font-weight: bold;">You are Logged in as, <?php echo "" . $_SESSION['uname'] . "!"; ?></li>
</ul><br><hr>
<?php
}
$host = "localhost";
$uname = "root";
$pass = "pranit";
$db_name = "rk_bookings";
$tbl_name = "bus_details";
mysql_connect("$host", "$uname", "$pass") or die("cannot connect");
mysql_select_db("$db_name") or die("cannot select DB");
$coname = $_POST['coname'];
$dest = $_POST['destination'];
$sql = "SELECT * FROM $tbl_name WHERE company='$coname' and destination='$dest'";
$result = mysql_query($sql) or die(mysql_error());
$rows = mysql_fetch_array($result, MYSQLI_ASSOC);
?>
<div id="disp">
<form action="update.php">
<table>
<tr>
<th>Company Name</th>
<th>Bus Facilities</th>
<th>Depart Time</th>
<th>Arrival Time</th>
</tr>
<tr>
<td><input type="text" name="coname" value="<?php echo $rows['company']; ?>"></td>
<td><input type="text" name="aminities" value="<?php echo $rows['aminities']; ?>"></td>
<td><input type="text" name="depart" value="<?php echo $rows['depart']; ?>"></td>
<td><input type="text" name="arrive" value="<?php echo $rows['arrive']; ?>"></td>
</tr>
<tr>
<th>Duration</th>
<th>Rate</th>
<th>From</th>
<th>To</th>
</tr>
<tr>
<td><input type="text" name="duration" value="<?php echo $rows['duration']; ?>"></td>
<td><input type="text" name="rate" value="<?php echo $rows['price']; ?>"></td>
<td><input type="text" name="start" value="<?php echo $rows['start']; ?>"></td>
<td><input type="text" name="destination" value="<?php echo $rows['destination']; ?>"></td>
</tr>
<tr>
<th style="border: none; background: none;"></th>
<td></td>
<th style="border: none; background: none; float: right;"></th>
</tr>
</table>
<button type="submit" name="submit">Update!</button><br><br><br>
</form>
<strong><a href="home.php">Click Here to Go Back!</a></strong>
<br><br><br>
</div>
</body>
</html>
|
|