I'm currently working on a little form that allows people to book a stay at a hostel. Basicly, I get them to pick two dates. (Day of arrival & day of departure) Then I want to calculate the difference between those dates in days, and finally I want to multiply the number of days with the price per day.
I can't seem to figure out how to calculate the days * price per day and pass that string on to the "amount value" in my form.
This is what I got so far:
<input type="text" id="datepicker" value="arrival (day-month-year)" />
<input type="text" id="datepicker2" value="departure (day-month-year)" />
<form action="checkout.php" method="post">
<input name="amount" type="hidden" value="$dateDiff * price per day = value">
<input type="submit" value="Check out" id="checkout">
</form>
And my PHP
<?php
$date1 = ("#datepicker");
$date2 = ("#datepicker2");
$dateDiff = $date1 - $date2;
$fullDays = floor($dateDiff/(60*60*24));
echo "Difference is $fullDays days";
?>
Edit: After the first two comments, let me explain that I'm fairly new to PHP. Thanks.