Cieszy mnie Pyton_000 że odezwałeś się w dzień świąteczny. Nie jest to kod na gotowca,tylko propozycja i zarys jak może to zrobić. Oczywiście kod w 60 sekund napisany
Niech chłopak ruszy z kopyta i zacznie już coś tworzyć. Może już ma jakis kod i podzieli się z nim. Można zrobić jeszcze wodotryski z użyciem ajaxa.
Pozdrawiam
PS.
A gotowca to szukaj za kasę w innym dziale kadela
A jeszcze dodam kod z wodotryskiem
<?php require_once('../Connections/local.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formkur")) { $insertSQL = sprintf("INSERT INTO wydarzenia (`data`, zdarzenie) VALUES (%s, %s)",
GetSQLValueString($_POST['dataa'], "date"),
GetSQLValueString($_POST['formwyd'], "text"));
$insertGoTo = "poli.php";
if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ?
"&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING'];
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Format date</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker();
$( "#format" ).on( "change", function() {
$( "#datepicker" ).datepicker( "option", "dateFormat", $( this ).val() );
});
} );
</script>
</head>
<body>
<p><br>
</p>
<form action="
<?php echo $editFormAction; ?>" method="POST" name="formkur" id="formkur">
<p>
<input name="dataa" type="text" id="datepicker" size="30">
Date: </p>
<p>
<select name="format" id="format">
<option value="mm/dd/yy">Default - mm/dd/yy</option>
<option value="yy-mm-dd">ISO 8601 - yy-mm-dd</option>
<option value="d M, y">Short - d M, y</option>
<option value="d MM, y">Medium - d MM, y</option>
<option value="DD, d MM, yy">Full - DD, d MM, yy</option>
<option value="'day' d 'of' MM 'in the year' yy">With text - 'day' d 'of' MM 'in the year' yy</option>
</select>
Format options:</p>
<p>
<label for="formwyd"></label>
<textarea name="formwyd" id="formwyd"></textarea>
Wpisz wydarzenie</p>
<input type="hidden" name="MM_insert" value="formkur">
<input type="submit" name="but" id="but" value="Wyślij">
</form>
<p> </p>
</body>
</html>
Wybierasz sobie formę wpisania daty do bazy ale przeważnie wybieraj forme YY-mm-dd aa góry rozwinie Ci się kalendarz i wpiszesz jakiś tam komentarztu jeszcze kod do połączenia z bazą
local.php
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_local = "localhost";
$database_local = "twoja baza";
$username_local = "tu twój nick do bazy";
$password_local = "twoje hasło do bazy";
?>