+ 1

Php problem help me plss

I am currently making a hotel system and it has check in date and check out date so I used <input type="date"> this is my form <form> Check in date:<input type="date" name="checkin"> Check out date:<input type="date" name="checkout"> </form> assuming the price per day is 1000 so if her check in date is march 20 and check out date is march 23 that would be 3 days. So what I want to happen is multiply the price by day she spent in the hotel base on what she inputs. Can someone help me ?

21st Mar 2018, 6:14 AM
Naruto Shippuden
Naruto Shippuden - avatar
8 Respuestas
+ 1
//Days stayed in hotel = x x = check_out_date - check_in_date total_cost = x * 1000 //is it what you are looking for?
21st Mar 2018, 11:58 AM
Nilesh
Nilesh - avatar
+ 1
no its just a logic to implement it.
21st Mar 2018, 2:03 PM
Nilesh
Nilesh - avatar
+ 1
yes, x is a variable
21st Mar 2018, 2:03 PM
Nilesh
Nilesh - avatar
+ 1
no. idk. but you should try it yourself. 😉
21st Mar 2018, 2:05 PM
Nilesh
Nilesh - avatar
0
yes like that . Is that the correct code? I'll try it
21st Mar 2018, 2:01 PM
Naruto Shippuden
Naruto Shippuden - avatar
0
is that "x" a variable ?
21st Mar 2018, 2:02 PM
Naruto Shippuden
Naruto Shippuden - avatar
0
ah . do you know the code ?
21st Mar 2018, 2:04 PM
Naruto Shippuden
Naruto Shippuden - avatar
0
huhuhu I thought you know . I was hoping 😭
21st Mar 2018, 2:08 PM
Naruto Shippuden
Naruto Shippuden - avatar