can anyone help me i have been trying to edit these functions to automatically enter todays dates in date open and date closed fields but with every thing i try it shows the date on screen but when posted it enters 0000-00-00 instead nyone got any ideas also does anyone know how i can change the format to uk when inseted thanks
<?php function addrec()
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><a href="users.php">Index Page</a></td>
</tr>
</table>
<hr size="1" noshade>
<form enctype="multipart/form-data" action="users.php" method="post">
<p><input type="hidden" name="sql" value="insert"></p>
<?php
$row = array(
"Key" => "",
"user name" => "",
"Password" => "",
"Date Open" => "",
"Date Closed" => "",
"Filter" => "",
"Active" => "");
showroweditor($row, false);
?>
<p><input type="submit" name="action" value="Post"></p>
</form>
<?php } ?>
<?php function showroweditor($row, $iseditmode)
{
global $conn;
?>
<table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
<tr>
<td class="hr"><?php echo htmlspecialchars("User Name")." " ?></td>
<td class="hr"><textarea cols="20" name="user_name" maxlength="65535"><?php echo str_replace('"', '"', trim($row["user name"])) ?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("Password")." " ?></td>
<td class="hr"><textarea cols="20" name="Password" maxlength="65535"><?php echo str_replace('"', '"', trim($row["Password"])) ?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("Date Open")." " ?></td>
<td class="hr"><input type="text" name="Date_Open" value="<?php echo str_replace('"', '"', trim($row["Date Open"])) ?>"</td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("Date Closed")." " ?></td>
<td class="hr"><input type="text" name="Date_Closed" value="<?php echo str_replace('"', '"', trim($row["Date Closed"])) ?>"></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("Filter")." " ?></td>
<td class="hr"><select name="Filter">
<?php
$lookupvalues = array("High","mediu","High'","Medium","Low");
reset($lookupvalues);
foreach($lookupvalues as $val){
$caption = $val;
if ($row["Filter"] == $val) {$selstr = " selected"; } else {$selstr = ""; }
?><option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option>
<?php } ?></select>
</td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("Active")." " ?></td>
<td class="hr"><select name="Active">
<?php
$lookupvalues = array("Y","N");
reset($lookupvalues);
foreach($lookupvalues as $val){
$caption = $val;
if ($row["Active"] == $val) {$selstr = " selected"; } else {$selstr = ""; }
?><option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option>
<?php } ?></select>
</td>
</tr>
</table>
<?php } ?>