Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 972 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Mod the way this script works

Thread title: Mod the way this script works
Closed Thread    
    Thread tools Search this thread Display Modes  
03-02-2005, 05:39 PM
#1
TheWebJunkie is offline TheWebJunkie
Status: Sin Binner
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 129
iTrader: 0 / 0%
 

TheWebJunkie is on a distinguished road

  Old  Mod the way this script works

Hello guys i was wondering if soem php guru could help me out by adding these new little tweaks to my script



Heres the exsisting code

PHP Code:
<?
require_once("../conn.php");
require_once(
"access.php");

if(!empty(
$_GET[Start]))
{
    
$Start $_GET[Start];
}
else
{
    
$Start '0';
}

$ByPage "10";

//get the users list
$q1 "select * from dd_users order by username limit $Start,$ByPage";
$r1 mysql_query($q1) or die(mysql_error());

if(
mysql_num_rows($r1) == '0')
{
    echo 
"<br><br><center><font color=red size=2 face=verdana><b>There are no registred users!</b></font></center>";
    exit();
}

?>


<br><br>
<table align=center width=600 cellspacing=0>
<tr style="background-color:#336699; color:white; font-family:verdana; font-size:11; font-weight:bold">
    <td width=200>Username</td>
    <td width=300>Email</td>
    <td width=100 align=center>Action</td>
</tr>

<?
$col 
"white";

while(
$a1 mysql_fetch_array($r1))
{
    if(
$col == "white" )
    {
        
$col "#dddddd";
    }
    else
    {
        
$col "white";
    }

    echo 
"<tr bgcolor=$col>\n\t<td>$a1[username]</td>\n\t<td>$a1[email]</td>\n\t<td align=center><a href=\"EditUser.php?UserID=$a1[UserID]\" class=GreenLink>edit</a> | <a href=\"DeleteUser.php?UserID=$a1[UserID]\" class=RedLink onclick=\"return DeleteUser();\">delete</a></td>\n</tr>\n\n";

}

echo 
"</table>\n\n";


//build the "next" - "prev" navigatioin

$qnav "select * from dd_users";

$rnav mysql_query($qnav) or die(mysql_error());
$rows mysql_num_rows($rnav);

        echo  
"<br><table align=center width=600>";
        echo 
"<td align=center><font face=verdana size=2> | ";

        
$pages ceil($rows/$ByPage);

        for(
$i 0$i <= ($pages); $i++)
        {
            
$PageStart $ByPage*$i;

            
$i2 $i 1;

            if(
$PageStart == $Start)
            {
                
$links[] = " <span class=DNav>$i2</span>\n\t ";

            }
            elseif(
$PageStart $rows)
            {
                
$links[] = " <a class=Nav href=ManageUsers.php?Start=$PageStart>$i2</a>\n\t ";    
            }
        }

        
$links2 implode(" | "$links);
        


        echo 
$links2;

        echo  
"| </td>";


        echo 
"</table><br>\n";

?>

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed