Forum Moderators: coopster
This code would select day 4 in a select field of 1-31 days,
having used getdate()
<?
$aday=4;
$day=1;
while($day <32){
if($aday==$day){ $select=" selected"; }
echo"<OPTION value=\"$day\" ".$select.">".$day."</OPTION>\n";
$day++;
$select="";
}
?>
<?php
if ($_POST['submitbutton']) {
your processing statements here;
}
#display the form again:
?>
<html>
<head>
</head>
<body>
<form method="post" action="<?php print $_SERVER['PHP_SELF'];?>">
<?php
$rows = mysql_query("SELECT * FROM tablename");
while ($row=mysql_fetch_array($rows)) {
print "<input type=\"text\" name=\"name\" value=\"$row['value']" />
}
?>
</body>
</html>