gudgip Posted September 21, 2007 Share Posted September 21, 2007 ok, my problem is in this script, <h4 class="hl">Search member!</h4> <?php if(!$Submitsearch){ echo "<div id=\"search\"><br /> <form action=\"\"><input name=\"qmember\" type=\"text\" value=\"\" size=\"35\" /> <input type=\"submit\" name=\"Submitsearch\" class=\"submit\" value=\"Search!\" /> </form> </div>"; } else { $searchmember = $_POST['qmember']; $queryu = mysql_query("SELECT * FROM users WHERE username = '$searchmember' ORDER BY userid DESC"); $result = mysql_num_rows($queryu); if(!$result){ echo "sorry, no users found"; } else { echo "<table class=\"users\">\n<tr>\n<td colspan=\"2\" class=\"tdusers\"><a href=\"/register\"> Register!</a></td>\n<td colspan=\"3\" class=\"tdusers\"><a href=\"/profile\">user list</a></td>\n</tr>\n</table>\n<table class=\"users\">\n<tr>\n<td class=\"topusers\" width=\"30px\">ID</td>\n<td class=\"topusers\" width=\"100px\">Avatar\n</td><td class=\"topusers\">Username</td>\n<td class=\"topusers\">Class</td>\n<td class=\"topusers\">Points</td>\n</tr>\n "; while($object = mysql_fetch_object($queryu)){ if($object->level == 1){ $class = member; } if($object->level == 9){ $class = admin; } echo "<tr>\n<td class=\"tdusers\"> $object->userid </td>\n<td class=\"tdusers\"><image height=\"70\" width=\"70\" src=\"$object->avatar\" /></td>\n<td class=\"tdusers\"><a href=\"profile&user=$object->username\">$object->username</a></td>\n<td class=\"tdusers\">$class</td>\n<td class=\"tdusers\"> 0 </td>\n</tr>\n"; } echo "</table>\n"; } } ?> this script is trying to search a member, if i use this script, nothing happens, but you can see the search-box thanks you! Link to comment https://forums.phpfreaks.com/topic/70186-search_membersphp-problem-cant-find-the-bug/ Share on other sites More sharing options...
recklessgeneral Posted September 21, 2007 Share Posted September 21, 2007 Hi, Unless you have register_globals switched on (which is a bad idea anyway), the value of $Submitsearch will not have been set even when the form has been submitted. Replace the first if statement with the following and see what happens: if (!isset ($_POST['Submitsearch'])) { echo "<form .... etc>"; } else { // Process form. } Let me know how that works out for ya, and if its still not working I'll scrutinize it a bit more. Cheers, Darren. Link to comment https://forums.phpfreaks.com/topic/70186-search_membersphp-problem-cant-find-the-bug/#findComment-352536 Share on other sites More sharing options...
gudgip Posted September 21, 2007 Author Share Posted September 21, 2007 there is no difference it just gets back to the search-page you can see the live-example on www.spreadthesource.org/search/users and thank you for the fast reply! Link to comment https://forums.phpfreaks.com/topic/70186-search_membersphp-problem-cant-find-the-bug/#findComment-352542 Share on other sites More sharing options...
gudgip Posted September 21, 2007 Author Share Posted September 21, 2007 i found it: it should be <form action=\"\" method=\"post\"> instead of: <form action=\"\"> thanks! Link to comment https://forums.phpfreaks.com/topic/70186-search_membersphp-problem-cant-find-the-bug/#findComment-352546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.