0

I want to send my check-in and check-out details to two pages which are x.php and y.php.

I have tried this code:

<form class="wrap-form-reservation size22 m-l-r-auto" action ="x.php","y.php" method="post">

The code above does not work. Please tell me the proper method of doing this.

i have a pages one is reservation.php it gets checkin and checkout detail from user and that datas sends to roomdetail.php to find available room and select the room. after select room it redirect to detail.php this what getting user details and total money and payments. for this i need to calculate how many days customer will be stay at hotel. therfore i need to ass checkin and checkout value to detail.php..

if any alternative method to solve this problem please kindly explain me

i used this technique to get checkin and checkout

$date1=$_SESSION["checkin"];
$date2= $_SESSION["checkout"];

$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
echo $days;

Now its working

Arebhy Sridaran
  • 586
  • 12
  • 28
  • 1
    Please specify, why you want to send your code to both pages. Do you want to open one in the current tab and the other one in a new tab? – Philipp Maurer Mar 13 '18 at 11:37
  • Deal with the post data in x.php and then include / require y.php in the same request so you still have post data available – Dale Mar 13 '18 at 11:37
  • Just use one page and make use of [cUrl](http://php.net/manual/en/book.curl.php) to relay the post – IsThisJavascript Mar 13 '18 at 11:39
  • Only add single page in action then call another page with `include` or `require` on that page – B. Desai Mar 13 '18 at 11:39
  • Use ajax with 2 post calls. – Lawrence Cherone Mar 13 '18 at 11:40
  • 1
    Sounds like an X-Y problem. Why do you need to send to two pages? Send it to a page that can perform both check-in and check-out handling. – Terry Mar 13 '18 at 11:44
  • i have a pages one is reservation.php it gets checkin and checkout detail from user and that datas sends to roomdetail.php to find available room and select the room. after select room it redirect to detail.php this what getting user details and total money and payments. for this i need to calculate how many days customer will be stay at hotel. therfore i need to ass checkin and checkout value to detail.php.. – Arebhy Sridaran Mar 13 '18 at 15:43

0 Answers0