Hi again!
After a bit of advice and help please...
I've just finished a private messaging php script, and on my "send message" page I have a select menu of users they can send to, along with a hidden div with a further 9 of those select menus to allow multi-recipient.
It loads pretty slow as each select menu I do this for:
<tr>
<th class="intro"><label>To:</label></th>
<td class="forminput"><select name="to[]" class="formwidth">
<?php
if ($frm1=='')
echo " <option value=\"\" selected=\"selected\">--- Please select the recipient ---</option>\n";
$users=mysql_query2("SELECT * FROM user WHERE deleted=0 ORDER BY account");
while ($user=mysql_fetch_array($users))
if ($user['account']!=$_SESSION['account']) {
echo " <option value=\"".$user['account']."\"".($user['account']==$frm1 ? ' selected="selected"' : "")."".($user['account']==$_POST['to'][0] ? ' selected="selected"' : "").">".$user['account']." (".bestGroup($user['account']).")</option>\n";
}
?>
</select><br /><br />
Is there a way just to select them once, but be able to echo them out 9 times where I want? Maybe something like an array? Unfortunately, a bit beyond me...!
The thing concerning me with that is that we keep the [0], [1] etc to put selected="selected" if there's an error to save the person having to select that person again.
Thank you in advance.