1. Here is the function where i will be allowed to consume the slot booked by me.
2. Here i check the unique reservation id, current server time & date.
3. Then i ask the user to enter the Unique reservation id, and i check it against the value of reservation id stored in my database. If it matches then the server sate is measured with the Start_date of the booking and also
4. the server time is matched with the reservation start time & endtime. If the current server time falls in between these two reservation times, then only the user is allowed to move to the real thing for which he booked the slot.
This is the code for the above mentioned but it is not working:
logintestform.html
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!-- Created with the CoffeeCup HTML Editor 2008 -->
<!-- http://www.coffeecup.com/ <tr>
<td width="150">Start date</td>
<td><input name="start_date1" type="int" id="start_date"></td>
</tr>
<tr>
<td width="150">Start Time</td>
<td><input name="starttime1" type="int" id="starttime"></td>
</tr> -->
<!-- Brewed on 11/19/2009 12:46:32 PM -->
<head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<form name="form1" method="post" action="testing.php">
<table width="400" border="1" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="150">Reservation Id</td>
<td><input name="resid1" type="text" id="resid"></td>
</tr>
<tr>
<td width="150"> </td>
<td><input type="submit" name="btnLogin" value="Login"></td>
</tr>
</table>
</form>
</head>
testing.php
Code: <?php
date_default_timezone_set('Asia/Kolkata');
$dbhost = 'localhost';
$dbuser = 'XXX';
$dbpass = 'XXX';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'phpscheduleit';
mysql_select_db($dbname,$conn) or die ("could not open db".mysql_error());
$userId = $_POST["resid1"];
$sql = "SELECT 'resid', 'start_date', 'starttime', 'endtime'
FROM reservations
WHERE resid = '$userId';
$result = mysql_query($sql)
or die('Query failed. ' . mysql_error());
if (mysql_num_rows($result) == 1) {
//$query1 = "SELECT 'start_date', 'starttime', 'endtime'
//FROM reservations";
//$result1 = mysql_query($query1)
// or die('Query failed. ' . mysql_error());
$today = date("H:i:s");
$today_date = date("m-d-y");
if ($today_date == 'start_date'){
} elseif($today >= 'starttime' && $today < 'endtime') {
echo "www.localhost/e1.html{user should navigate to this page}";
} elseif($today == 'endtime') {
echo "www.localhost/index.php"
} else{
echo " today is not your booking day"
} else {
echo "Please check your reservation id";
}
}
?>
type check while uploading
Hi Everyone,How can I check the exact type of a file while uploading on my site?Here is the scenario:I have allowed only .jpg, .gif, .png files to be uploaded on my site. Suppose an user renames his
Save User Inputs while javascript reloading!
hi..i have written a PHP code in which i reload the page when user selects a value in dropdown...Code: function reload(form){var
Help With editting and deleting form
Hallo !!So look at this image :http://img194.imageshack.us/img194/8272/snapshot5f.png This table prints the titles of entries from a table in a database.. The code that i use for this table is this
What are causes of a connection-timeout with fopen()?
Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.* to 5.2.4. Not just PHP was upgraded, MySQL, postGres, and (I think) Apache were upgraded as well.
Multiple arrays inside data
Hi,Simple question. I have a column called "array" in my database, and inserted into each field is the following imploded array:Code: mctriangle,570.65,355.1,1,1,0It is an instance of an
PHP Multiples of 2, Show posts...not working (wordpress)
I have been using this code to show div.example with 6 li columns inside it, each li is a post with its info inside.Once it gets to the 6th li it closes the div.example and starts a new one. This to
Warehouse Management
Hi,
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database assigns an ID number. The front end displays each upload by ID number. I'm trying to set up the back
help with multi-update
Now sure how to ask this really....
Got A Free Server :(
So I was given a free server http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1990708735It is a Compaq Proliant 1500 :|And I cannot seem to get it to install any OS from the CD drive