Nicholas Posted January 21, 2010 Posted January 21, 2010 hi all, im wondering could amyone update this mod for me? ive tried doing it loads of times but keep on getting errors... im wondering could you add a PAGES function in it please so it only displays 50 players at a time on each page? <?php include("globals.php"); echo '<h1>Search For a User</h1>'; if($_POST['username']) { $name = mysql_real_escape_string($_POST['username']); $fetch = mysql_query("SELECT userid,username,money,crystals FROM users WHERE username LIKE('%".$name."%')"); echo ' User\'s found: '.mysql_num_rows($fetch).' <center><table width=50% cellspacing=1 class=table border=1 bordercolor=#636363></center> <tr> <th>Username</th> <th>Money</th> <th>Knifes</th> <th>Attack?</th> </tr>'; if(mysql_num_rows($fetch) == 0) { echo ' <tr> <td colspan="4"> <center> No user\'s found </center> </td> </tr> </table>'; $h->endpage(); exit; } while($soc = mysql_fetch_assoc($fetch)) { echo ' <tr> <td><center>[url="viewuser.php?u='.$soc['userid'].'"]'.$soc['username'].' ['.$soc['userid'].'][/url]</td> <td><center>'.money_formatter($soc['money']).'</td> <td><center>'.number_format($soc['crystals']).'</td> <td><center>[url="attack.php?ID='.$soc['userid'].'"]Attack[/url]</td> </tr> <tr>'; } echo ' </tr> </table>'; $h->endpage(); exit; } if($_POST['ID']) { header("Location: viewuser.php?u=".$_POST['ID']); exit; } if($_POST['loc']) { $l = abs(@intval($_POST['loc'])); $rows = mysql_query("SELECT userid,username,money,crystals FROM users WHERE location=".$l); echo ' User\'s found: '.mysql_num_rows($rows).' <center><table width=50% cellspacing=1 class=table border=1 bordercolor=#636363></center> <tr> <th>Username</th> <th>Money</th> <th>Knifes</th> <th>Attack?</th> </tr>'; if(mysql_num_rows($rows) == 0) { echo ' <tr> <td colspan="4"> <center> No user\'s found </center> </td> </tr> </table>'; $h->endpage(); exit; } while($soc = mysql_fetch_assoc($rows)) { echo ' <tr> <td><center>[url="viewuser.php?u='.$soc['userid'].'"]'.$soc['username'].' ['.$soc['userid'].'][/url]</td> <td><center>'.money_formatter($soc['money']).'</td> <td><center>'.number_format($soc['crystals']).'</td> <td><center>[url="attack.php?ID='.$soc['userid'].'"]Attack[/url]</td> </tr> <tr>'; } echo ' </tr> </table>'; $h->endpage(); exit; } echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post"> <center><table width=75% cellspacing=1 class=table border=1 bordercolor=#636363></center><tr> <td> <center>Search by name:</td> <td> <center><input type="text" name="username"></td> <td> <center><input type="submit" value="Search By Name"></td></tr><tr> <td> <center>Search by ID:</td> <td> <center><input type="text" name="ID"></td> <td> <center><input type="submit" value="Search By ID"></td></tr><tr> <td> <center>Search by Location:</td> <td> <center><select name="loc" type="dropdown">'; $fe = mysql_query("SELECT cityid,cityname FROM cities WHERE cityminlevel <= ".$ir['level']); while($soci = $db->fetch_row($fe)) { echo '<option value="'.$soci['cityid'].'">'.$soci['cityname'].'</option>'; } echo ' </select></td> <td> <center><input type="submit" value="Search By Location"> </form></td></tr></table>'; $h->endpage(); ?> Quote
Jordan Palmer Posted January 29, 2010 Posted January 29, 2010 Why would you want page's on search? =/ Quote
Magictallguy Posted January 29, 2010 Posted January 29, 2010 Perhaps more than x amount of players found stretch the page ;) I've done it on my game ;) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.