I recently added a sql populated drop down box to the homepage of a web project that I am working on http://j2software.co.uk/leaguesql/index.php. If you're in anything other than Safari (or possibly chrome, I haven't tried that yet) then you will see that there is a problem with how it is displayed. Its looks fine for me in Safari but obviously not everyone is going to be using safari and its not just an aesthetic problem, it actually effects the functionality of the site.
Here is the code snippet for the drop down section, I would be very grateful for any help on correcting this as i'm nearing the final stretch to v1.0.
<div class="search_field">
<!-- SQL Populated Drop Down -->
<form method="post" action="showleague.php">
<?php
error_reporting(E_ALL);
//Connect & Select.
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jsoftwa1_LeagueSQL", $con);
$result = mysql_query("SELECT LeagueName FROM League_Index");
while ($data=mysql_fetch_assoc($result)){
?>
<span class="search">Select a league:</span>
<select name="leagueName">
<option value ="<?php echo $data['LeagueName'] ?>" ><?php echo str_replace('_', ' ', $data['LeagueName']) ?></option>
<?php } ?>
</select> <input type="submit" value="view" class="button" />
</form>
</div>
I just noticed, what I think MAY be causing it but i'm dual booted and running W7 atm, my code is on my OS X partition, so it'll have to wait while morning but if somebody could credit or discredit this theory then that would be fantastic.
Here is what I think the above code SHOULD be -
<div class="search_field">
<!-- SQL Populated Drop Down -->
<form method="post" action="showleague.php">
<span class="search">Select a league:</span>
<select name="leagueName">
<?php
error_reporting(E_ALL);
//Connect & Select.
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jsoftwa1_LeagueSQL", $con);
$result = mysql_query("SELECT LeagueName FROM League_Index");
while ($data=mysql_fetch_assoc($result)){
?>
<option value ="<?php echo $data['LeagueName'] ?>" ><?php echo str_replace('_', ' ', $data['LeagueName']) ?></option>
<?php } ?>
</select> <input type="submit" value="view" class="button" />
</form>
</div>