Code working in Firefox but not in IE
Posted: Thu Mar 09, 2006 5:31 pm
Hi there,
I am working on some code which will search my forums for a users ID.
The following code works fine with firefox, you search for a name, that appears in the drop down box, then it shows an id number in an input box.
For some reason, when used in IE and Safari, the drop down list box part doesn't work. It doesn't display any names in the box at all.
If anybody know's where I'm going wrong I'd be very grateful
I am working on some code which will search my forums for a users ID.
The following code works fine with firefox, you search for a name, that appears in the drop down box, then it shows an id number in an input box.
For some reason, when used in IE and Safari, the drop down list box part doesn't work. It doesn't display any names in the box at all.
If anybody know's where I'm going wrong I'd be very grateful
Code: Select all
<table width="300" border="0">
<tr>
<td width="150" valign="top">
<font face="arial" size="1">
<form name="authsearch" method="post" action="auth_search.php">
<input type="hidden" name="actionflag" value="authname">
Search for Username:<br />
<input type="text" size="20" name="author" class="auth_input">
<input type="submit" value="search" class="auth_input">
</form>
</font>
</td>
<td width="150" valign="top">
<font face="arial" size="1">
<?php
if( isset($actionflag) && $actionflag == "authname"){
?>
<form name="authselect" method="post" action="auth_search.php">
<input type="hidden" name="actionflag" value="authselect">
<select name="authresult" class="auth_input">
<?php
$sql = "SELECT * FROM phpbb_users WHERE username LIKE '%$author%'";
$result = mysql_query ( $sql, $link2 );
if(!$result){
die ( "addfeature error: ".mysql_error() );
}
while ($auth_row = mysql_fetch_array($result)){
echo ( '<option" value="' . $auth_row[user_id] . '">' . $auth_row[username] .'</option>' );
}
?>
</select>
<input type="submit" value="select" class="auth_input">
</form>
<?php
}
if( isset($actionflag) && $actionflag == "authselect"){
$sql = "SELECT username FROM phpbb_users WHERE user_id = '$authresult'";
$result = mysql_query ( $sql, $link2 );
$name = mysql_fetch_array ($result);
echo ( 'User ID for ' . $name[username] . ': <br><input type="text" value="' .$authresult. '" size="5" class="auth_input">');
}
?>
</font>
</td>
</tr>
</table>