Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- $host="";
- $username="";
- $password="";
- $database="";
- mysql_connect($host,$username,$password);
- @mysql_select_db($database) or die( "Unable to select database");
- $fetch = mysql_query("SELECT * FROM users ORDER BY RANK ASC LIMIT 0, 20")or
- die(mysql_error());
- $num=mysql_numrows($fetch);
- ?>
- <?PHP
- //check if the starting row variable was passed in the URL or not
- if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
- //we give the value of the starting row to 0 because nothing was found in URL
- $startrow = 0;
- //otherwise we take the value from the URL
- } else {
- $startrow = (int)$_GET['startrow'];
- }
- ?>
- <?PHP
- //this part goes after the checking of the $_GET var
- $fetch = mysql_query("SELECT * FROM users ORDER BY RANK ASC LIMIT $startrow, 20")or
- die(mysql_error());
- mysql_close();
- ?>
- <style type="text/css">
- table.fancy {
- margin: 1em 1em 1em 0;
- background: whitesmoke;
- border-collapse: collapse;
- }
- table.fancy tr:hover {
- background: #CC0000 !important;
- }
- table.fancy th, table.fancy td {
- border: 1px silver solid;
- padding: 0.2em;
- }
- table.fancy th {
- background: #990000;
- text-align: left;
- }
- table.fancy caption {
- margin-left: inherit;
- margin-right: inherit;
- }
- </style>
- <table class="fancy"><center>
- <tr>
- <th width="25%"><center>Name</center></th>
- <th width="15%"><center>SteamID</center></th>
- <th width="25%"><center>Rank</center></th>
- </tr></center>
- <?
- $i=0;
- while ($i < $num) {
- $ID=mysql_result($fetch,$i,"ID");
- $NAME=mysql_result($fetch,$i,"NAME");
- $RANK=mysql_result($fetch,$i,"RANK");
- ?>
- <tr>
- <td><font face="Arial, Helvetica, sans-serif"><center><? echo $NAME; ?></center></font></td>
- <td><font face="Arial, Helvetica, sans-serif"><center><? echo $ID; ?></center></font></td>
- <td><font face="Arial, Helvetica, sans-serif"><center><?
- if ( $RANK == 0 ){
- echo "<font color=\"red\"><b>Owner</b></font>";
- }
- elseif ( $RANK == 1 ){
- echo "<font color=\"orange\"><b>Super Administrator</b></font>";
- }
- elseif ( $RANK == 2 ){
- echo "<font color=\"green\"><b>Administrator</b></font>";
- }
- elseif ( $RANK == 3 ){
- echo "<font color=\"pink\"><b>Trial Administrator</b></font>";
- }
- elseif ( $RANK == 4 ){
- echo "<font color=\"blue\"><b>VIP</b></font>";
- }
- elseif ( $RANK == 5 ){
- echo "Registered User";
- } ?></center></td>
- </tr>
- <?
- $i++;
- }
- echo "</table>";
- ?><center>
- <?PHP
- //now this is the link..
- echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow+20).'">Next</a>';
- ?>
- <?PHP
- $prev = $startrow - 20;
- //only print a "Previous" link if a "Next" was clicked
- if ($prev >= 0)
- echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.$prev.'">Previous</a>';
- ?></center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement