#10
<select name="aar" size ="1"
</select>
her mangler din select at blive afsluttet (>)
lavede et kort test eks bseret på din code, der virker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
$ord_liste = array("hest", "hund", "kat", "mus"); // skal komme fra db
?>
<form action="slet_fra_dato.php" method="post">
<select name="tekst" size="1">
<?php
foreach ($ord_liste as $value) {
?>
<option value="<?php echo $value; ?>"><?php echo $value; ?></option>
<?php
}
?>
</select>
<select name="dag" size="1">
<?php
for ($i = 1; $i <= 31; $i++) {
?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php
}
?>
</select>
<select name="md" size="1">
<?php
for ($i = 1; $i <= 12; $i++) {
?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php
}
?>
</select>
<select name="aar" size ="1">
<?php
for ($year_now = date("Y"), $year_start = $year_now - 10; $year_start <= $year_now; $year_start++) {
?>
<option value="<?php echo $year_start; ?>"><?php echo $year_start; ?></option>
<?php
}
?>
</select>
<input type="submit" value="Slet"/>
</form>
</body>
</html>
slet_fra_dato.php
<?php
$str = $_POST['tekst'];
$dag=$_POST['dag'];
$md=$_POST['md'];
$aar=$_POST['aar'];
$fra=$aar.$md.$dag;
echo '<br>STR er = '.$str;
echo '<br> FRA er = '.$fra;
?>