Jump to content

Reservation details - Hotel


edoplaza

Recommended Posts

Hello,

 

I need some help here. I am going to build a Web site about a little hotel. It is actually a house with 6 rooms, nothing more. The client wants a reservation page, with simple information like: Name, telephone number, e-mail, dates of check-in and check out, number of rooms, gests per room, etc. I'm just concerned with two things:

 

1. For the dates, I'd like to add a calendar button, something like this:

 

http://ww w.holidayinn.com/h/d/hi/1/en /home#

 

 

2. I'd like to display the total total amount at the end of the reservation

 

 

 

Regards,

 

Eduardo

Link to comment
Share on other sites

Hi edoplaza,

 

if you want to display the information in the same page where you insert your data then user mysql_insert_id() after you run your insert query which fetches the lates id of data inserted.

 

If you wish to show the information in different pages then you can do the following.

 

<?php 
session_start();
//add a new row called sessionid in the table and while inserting the value put session_id() for it.
//eg: 
insert into your table (name,address,sessionid) values ("abc","bcd",'".session_id()."');
//then you can take out that record from the database any time until the user closes his browser.
//eg: 
select * from your table where sessionid='".session_id()."';
?>

 

Remember that this sessionid is valid for only once, this session id is always different for every user and is valid for only one user session.

Edited by bishwadeep
Link to comment
Share on other sites

Hey, thank you very much, now I understand what you mean. However when I test the pages it gives me this:

 

Warning: Cannot modify header information - headers already sent by (output started at /home5/musicaen/public_html/puntabahareque/reservation1.php:4) in /home5/musicaen/public_html/puntabahareque/reservation1.php on line 51

 

 

I put 2 new pages with your code:

 

http://www.puntabahareque.com/reservation1.php

 

and

 

http://www.puntabahareque.com/feedback1.php

 

I checked line 51 and it has this code:

 

header(sprintf("Location: %s", $insertGoTo));

 

 

I don't know what that means

 

 

Regards,

 

Eduardo

Link to comment
Share on other sites

HI edoplaza,

 

I think you have a space before your <? starting tag. This type of warning message generally arises when there is a space before the opening tag.

-----------------------------------------------

ELIMINATE SPACE HERE <?

 

?>

-----------------------------------------------

Link to comment
Share on other sites

Thank you very much! Now it works. The only problem is that the feedback page is still showing the first line of the DataBase.

I checked on PHPmyAdmin and the information is being updated correctly, I mean, when you enter a new name and last name, they appear on the database but not on the feedback page.

 

Thanks again

 

Eduardo

Link to comment
Share on other sites

Hi edoplaza,

This is because you have test the page several time using the same session.

In real time this will not be the case. the user will fill the form once and he will close the browser.

 

if you want to use the page in the realtime mode then you have to clear the browser cookie and session each time after filling the form.

 

Currently you might notice that there might be same sessionid for different records in the database. This is because you are filling the form multiple times in the same user session.

Edited by bishwadeep
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...