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";
}
}
?>
Allegro crashes when running load_bitmap. Why?
I can not get Allegro to load any BMP images. Here is a section of test code. The picture is in the working directory:BITMAP *my_pic; my_pic = load_bitmap("kirby.bmp", NULL); if(!my_pic)
cURL proxy
Okay here is the thing... i know how to add proxysCode: curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);curl_setopt($ch, CURLOPT_PROXY,"[i][b]PROXYHERE[/b][/i]");Here are my questions..
MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an error... and was hoping someone could help me out.You have an error in your SQL syntax; check the manual
php web service error
hey guys,I'm working on a project requires the use of web services. I've been trying a few tutorials and I get this one persistent error. I've search the web for clues, even this forum and nothing
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords aligned by our active directory to the same as those used to access the Network. My query is that we
Multiple PHP errors when clicking a link..and..removing a ghost..
Hi - I have 2 problems with a new website - homeswapvacations.com, which I need help solving.The first problem - In the left column (on all pages) is "Featured Listing" column (in the admin
ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
Auto fill in input value based on User_ID
Hello,I'm looking form some input on the following problem.User loads page -> page loads values from database and inputs them in boxes -> user edits input boxes -> new values
Handling text changed in text box control using Ajax
I need to create a web form with a text box control. When someone types text into the textbox I need to post back to a C# or VB method to handle the changed text entered into the text box control.Is
IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with the php function getimagesize() and path names.When using these two different sets of code:Code: