Hi
I explain what I have, user will visi the site to change booking detail using their client and booking ID, once thy typed their client ID they will be directed to another page where they will be welcomed and they will be presented with a form to enter the booking ID they need to change and their new booking detils.
My question is what is the if statement which only show the second part (Form) to the user only if they have typed corecet client ID. i.e if their is no recored of then they shoud get an error message saying that we don’t have a recored for you please try again.
Hope i have manged to explain my question well. Below is the code which i am using in my page.
I explain what I have, user will visi the site to change booking detail using their client and booking ID, once thy typed their client ID they will be directed to another page where they will be welcomed and they will be presented with a form to enter the booking ID they need to change and their new booking detils.
My question is what is the if statement which only show the second part (Form) to the user only if they have typed corecet client ID. i.e if their is no recored of then they shoud get an error message saying that we don’t have a recored for you please try again.
Hope i have manged to explain my question well. Below is the code which i am using in my page.
Code:
<html>
<head>
<title>change Booking Details</title>
</head>
<body>
<?php
// Have they entered a ClientID?
if(empty($_POST['clientID']))
{
die("Please enter your correct BookingID number.");
}
$con = mysql_connect("xxxxxxxx","xxxxxx","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxxxxxx", $con);
$result = mysql_query("SELECT * FROM clients WHERE clientID=$_POST[clientID]");
// if statment should start here
// if statment should finish here
while($row = mysql_fetch_array($result))
{
print "Hi";
echo(" ");
echo $row['firstname'] . " " . $row['surname'];
echo(" ");
echo("welcome back you can change your booking using the form below ");
echo "<br />";
}
mysql_close($con)
?>
<p> hi </p>
<form name="form1" method="post" action="../actions/booking_updated.php">
<table width="75%" border="1">
<tr>
<td>Bookin ID</td>
<td><input type="text" name="bookingID"></td>
</tr>
<tr>
<td width="34%">Arrival Date</td>
<td width="66%"> <input name="startdate" type="text" id="startdate" maxlength="10">
(yyyy-mm-dd) </td>
</tr>
<tr>
<td>Departure Date</td>
<td><input name="enddate" type="text" id="enddate" maxlength="10">
(yyyy-mm-dd) </td>
</tr>
<tr>
<td>Room Type</td>
<td><select name="roomtype" id="roomtype">
<option value="Single">Single</option>
<option value="Double">Double</option>
<option value="Suite" selected>Suite</option>
</select></td>
</tr>
<tr>
<td>Number of Adults:</td>
<td><select name="adults" id="adults">
<option value="1">1</option>
<option value="2">2</option>
</select></td>
</tr>
<tr>
<td>Number of Children:</td>
<td><select name="children" id="children">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select></td>
</tr>
<tr>
<td>Special Requirments</td>
<td><textarea name="requirements" cols="30" id="requirements"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input name="updatebooking" type="submit" id="updatebooking" value="Update Booking"></td>
</tr>
</table>
<p> </p>
</form>
<p> </p>
</body>
</html>