Quote:
Originally posted by Pat Phelan
In PHP dates are just integers. You can use:
PHP Code:
$today = Getdate();
$tomorrow = 1 + $today;
So, if the user enters a date for check-in, you can easily compute a default check-out date by adding 1 to the check-in date. This can be done interactively, in the browser instead of requiring a round-trip to the database.
-PatP
|
Cheers :-)
Thank you Pat!
I'm new to PHP, but I do tried this:
PHP:--------------------------------------------------------------------------
// get fields from form
$x_RecordID = @$HTTP_POST_VARS["x_RecordID"];
$x_hyperlink = @$HTTP_POST_VARS["x_hyperlink"];
$x_PublicPrice = @$HTTP_POST_VARS["x_PublicPrice"];
$x_StarRating = @$HTTP_POST_VARS["x_StarRating"];
$x_DepartureID = @$HTTP_POST_VARS["x_DepartureID"];
$x_ArrivalID = @$HTTP_POST_VARS["x_ArrivalID"];
$x_CheckinDate = @$HTTP_POST_VARS["x_CheckinDate"];
$x_Cruise = @$HTTP_POST_VARS["x_Cruise"];
$x_length = @$HTTP_POST_VARS["x_length"];
$x_CheckoutDate = @$HTTP_POST_VARS["x_CheckoutDate"];
$x_checkindate = Getdate();
$x_heckoutdate = 1 + $x_checkindate;
I added
$x_checkindate = Getdate();
$x_heckoutdate = 1 + $x_checkindate;
PHP:--------------------------------------------------------------------------
Then it shows, Fatal error: Unsupported operand types
Please help, thanks!