Posted on: 05/17/03 04:07am
By: Anonymous (nctek)
I searched, but couldn't find anything on this, except one thing, but that wasn't useful. What I need to do is make a drop down list of usernames. I have absolutely no idea how to do this, but what I have come up with so far is
<select name="author">
<option selected="selected" value="0">{lang_all}</option>
{author_option_list}
</select>
This is from the search.thml file. It pulls out a list of authors, but it only pulls out a list of authors that have made contributions. I need to get all the users list. How can I do this? I am not using any of the template files, so I would just need to make it in a PHP file either using HTML or something. :-/
Please help! :-(
nctek.net
drop down
Posted on: 05/17/03 01:26pm
By: rawdata
Add: require_once('lib-common.php'); at the top of your file then this snippet will generate a drop down menu of all users:
$display = '<select name="users">';
$result = DB_query("SELECT uid, username FROM {$_TABLES['users']} ORDER by username"
;
$numrows = DB_numRows($result);
for ($i = 1; $i <= $numrows; $i++) {
$A = DB_fetchArray($result);
$users .= '<option value="' . $A['uid'] . '">' . $A['username'] . '</option>';
}
$display .= $users . '</select>';
echo($display);
drop down
Posted on: 05/17/03 04:53pm
By: Anonymous (nctek)
THANKS!!! That worked, but I'm still having one more problem.
http://www.nctek.net/memo_send.php
Whenever I have the drop down list then I try to send a message, it says that user name does not exist. Any idea why? How would I go about fixing this? THANK YOU in advance---~nish
visit: nctek.net
drop down
Posted on: 05/18/03 03:16am
By: rawdata
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
drop down
Posted on: 05/18/03 06:26am
By: Anonymous (nctek)
Yeh, it was renamed, but I have decided that I wont use drop down menu's and the person can just type the name in. Its cool..Thanks for the help though Dirk.---~nish
visit: nctek.net
drop down
Posted on: 05/19/03 02:02am
By: Blaine
Geeklog also has a nice COM function to make coding the Select Dropdown input fields easier. It will perform the SQL query and build the HTML select options. Using the same example:
$display = '<select name="users">';
$display .= COM_optionList($_TABLES['users'],'uid','username') . '</select>';
echo($display);
Blaine
drop down
Posted on: 05/21/03 03:37am
By: Anonymous (nctek)
i added this code, and made the list of users just as a list so they can get user name from it becaues it doesn't seem to work for some reason. I have absolutely no idea why. It keeps saying, the user does not exist.
http://www.nctek.net/send.php
<INPUT TYPE="text" NAME="username" VALUE="<?php echo $_GET['to']; ?>">
thanks for the help guys,
nctek.net
<?php
$display = '<select name="users">';
$display .= COM_optionList($_TABLES['users'],'uid,username',$A['users'],1) . '</select>';
echo($display);
?>---~nish
visit: nctek.net