The script creates a hidden textbox, with the name equivalent to the first argument passed on DateInput() function.
With that said, you can get the value of the date (as what John said) via get/post method.
Here's a basic example on how to make this work using POST method:
PHP Code:
<?php
/***********************
Start of DB details
***********************/
$user = "db_user"; // DB Username
$pass = "db_pass"; // DB pass
$name = "db_name"; // DB Name
$host = "localhost"; // DB Host
$webmaster = "webmaster@site.com" ; // Set the webmaster's email here
///// No need to edit beyond this line
$db=mysql_connect($host,$user,$pass) or die("Connection refused. Please check your database or contact the <a href='mailto:".$webmaster."'>webmaster</a>."); // Establish a connection
mysql_select_db($name,$db); // Select DB
/***********************
End of DB details
***********************/
$inp = $_POST['fromdate']; // Get the textbox that holds the date
$table_name='table_name'; // Set the name of your table
$col_name = 'fromdate'; // Set the column that will hold the dates
if(isset($_POST['submit']))
{
$sQuery = "INSERT INTO $table_name ($col_name) VALUES ('$inp')"; // Insert query
mysql_query($sQuery) or die(mysql_error()); // Do the query
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<script>DateInput('fromdate', true, 'DD-MON-YYYY')</script>
<input type="submit" name="submit" value="Submit">
</form>
For the GET method, you could use $_GET['querystring'].
Hope that helps.
Bookmarks