469,588 Members | 2,741 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,588 developers. It's quick & easy.

how to assign textbox value as php variables?

17
may i know if in php i can assign the textbox value from the user input as variables and then display the result of in the same page.

assume, user insert the checkin and checkout date, then it wil automatically show the numbers of the day the user will stay at the hotel.

any suggestion will really appreciates because i have no ideas what should i do ...

below is the code

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-1.css" title="win2k-cold-1" />
  6. <script type="text/javascript" src="Kalendar/calendar.js"></script>
  7. <script type="text/javascript" src="Kalendar/calendar-en.js"></script>
  8. <script type="text/javascript" src="Kalendar/calendar-setup.js"></script>
  9. <script type="text/javascript" src="Kalendar/ew.js"></script>
  10. <script type="text/javascript"></script>
  11. <title>SistemAPOS</title>
  12. <style type="text/css">
  13. <!--
  14. .style7 {color: #FFFFFF}
  15. .style8 {
  16.     color: #000000;
  17.     font-weight: bold;
  18. }
  19. .style10 {color: #FFFFFF; font-weight: bold; }
  20. .style11 {font-weight: bold}
  21. -->
  22. </style>
  23.  
  24. </head>
  25.  
  26. <body>
  27.  
  28. <form action="findroom.php" method="post">
  29.  
  30.   <p>Check Room Availbility</p>
  31.   <p>Date In
  32.     <label>
  33.       <input type="text" name="datein" id="datein" />
  34.       <input name="datein" type="image" id="dateA" src="Kalendar/ew_calendar.gif" width="16" height="15" border="0" />
  35.   <script type="text/javascript">
  36.                     </script>
  37.             </strong>
  38.   <script type="text/javascript">Calendar.setup(
  39.                     {
  40.                         inputField : "datein", // ID of the input field
  41.                         ifFormat : "%Y-%m-%d", // the date format
  42.                         button : "dateA" // ID of the button
  43.                     }
  44.                     );
  45.                     document.write(ifFormat);
  46.                     </script>
  47.     </label>
  48.   </p>
  49.   <p>Date Out
  50.     <input type="text" name="dateout2" id="dateout" />
  51.     <input name="dateout" type="image" id="dateB" src="Kalendar/ew_calendar.gif" width="16" height="15" border="0" />
  52.     </strong>
  53.     <script type="text/javascript">Calendar.setup(
  54.                     {
  55.                         inputField : "dateout", // ID of the input field
  56.                         ifFormat : "%Y-%m-%d", // the date format
  57.                         button : "dateB" // ID of the button
  58.                     }
  59.                     );
  60.                     document.write(ifFormat);
  61.                     </script>
  62.   </p>
  63.   <p>Number of Days : Supposely this is the place where it will display how many days the user will stay</p>
  64.   <p>
  65.     <label>
  66.       <input type="submit" name="Check" id="Check" value="Submit" />
  67.     </label>
  68.   </p>
  69. </form>
  70. </body>
  71. </html>
  72.  
  73.  
  74.  
Mar 18 '10 #1
2 5958
Magnie
3
Is there any way you could explain what you want in more depth?
Mar 18 '10 #2
digituf
17
finally i know that i need to use javascript to solve this matter as i don't need to execute it at server
Mar 20 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Eric | last post: by
2 posts views Thread by dskillingstad | last post: by
2 posts views Thread by Grey | last post: by
8 posts views Thread by Sergei | last post: by
7 posts views Thread by I am Sam | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.