Hi,
I have a drop down list loaded from a mysql database that works fine in Firefox, but does not return the selected value on POST when executed in IE8.
If this a known issue? Is there a work-around?
Code to build the drop down list is as follows:
<?php
$dbcon = @mysql_connect('localhost', 'readonly', 'readonly');
if (!@mysql_select_db('ballymoney')) {
// Login failed.
echo "<script>alert('Login failed!')</script>";
}
$result = mysql_query("select crdate from creports order by crdate desc");
echo "<label>Select Competition Date, then click the GO button : </label>";
echo "<select \"name=\"compdate\"> id=\"compdate\">\n";
while ($row = mysql_fetch_assoc($result)) {
$date = $row['crdate'];
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$day = substr($date, 8, 2);
$dmydate = $day . "/" . $month . "/" . $year;
echo "<option value=$dmydate>$dmydate</option>\n";
}
echo "</select>";
?>
Code to process selected value is as follows:
<?php
if (isset($_POST['compdate'])) {
$datedmy = $_POST['compdate'];
$year = substr($datedmy, 6, 4);
$month = substr($datedmy, 3, 2);
$day = substr($datedmy, 0, 2);
$dateymd = $year . "/" . $month . "/" . $day;
$result = mysql_query("select * from creports where crdate = '" . $dateymd . "'");
}
else {
$result = mysql_query("select * from creports order by crdate desc limit 1");
}
$row = mysql_fetch_assoc($result);
$date = $row['crdate'];
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$day = substr($date, 8, 2);
$dmydate = $day . "/" . $month . "/" . $year;
echo "<p>Competition Date : " . $dmydate . "</p>";
echo "<p>Competition Type : " . $row['crdesc'] . "</p>";
echo "<p>Competition Report : </p>";
echo "<p>" . $row['crreport'] . "</p>";
?>
Jennifer