Jump to content

[SOLVED] Turning 3 date variables into 1?


Steppio

Recommended Posts

Hi, i have a small problem concerning dates in PHP. I wish to take 3 options from 3 seperate drop-down boxes, POST them to a seperate page, checkdate all 3 selections together and them convert them into ISO 8601 format so i can store them in my database. My code after the POST is:

 

<?php
require_once('main_fns.php');
session_start();
check_valid_user();

$month = $_POST['month'];
$day = $_POST['day'];
$year = $_POST['year']; 
checkdate($day, $month, $year);

$gigvenue = $_POST['add_venue'];
$gigtime = $_POST['time'];
$gigprice = $_POST['price'];
$gigaddress = $_POST['add_address'];
$gigcomments = $_POST['add_comments'];

try
{
//check forms filled in
if (!filled_out($_POST))
{
	throw new Exception('You have not filled out the form correctly '.
								'- please go back and try again.');
}
add_gigs($gigdate, $gigvenue, $gigaddress, $gigtime, $gigprice, $gigcomments);
require('head.inc');
echo 'Your gig was succesfully added, thank you for your time. <br />';
echo '<a href="gigs.php?<?php echo strip_tags(SID); ?>">Go to the gigs page...</a>';
require('foot.inc');
}
catch (Exception $e)
{
require('head.inc');
echo $e->getMessage();
require('foot.inc');
exit;
}
?>

 

Basically i'd just like to add the $day, $month and $year variables into 1 variable. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/52348-solved-turning-3-date-variables-into-1/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.