Jump to content

adding pagination guidance?


xcoderx

Recommended Posts

guys i got this piece o coding and i want to add limit of pages to it could someone guide me through so that i can get it done? im not good at it but im ready to learn so that next time i do not have to ask for help.

 

<?php
echo "<center>";
echo "<h2>Images</h2>";
echo "</center>";
$columns = 5;
$cardurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
function displayCard(){
    global $columns;    
    $action = 0;
    // Open the actual directory
    if ($handle = opendir("thumbs")) {
        // Read all file from the actual directory
        while ($file = readdir($handle))  {
            if (!is_dir($file)) {
                if ($action == 0) 


               echo "<tr>";
                
                echo "<td align='center'>
                     <img src='thumbs/$file' width='128' height='128' alt='image' /><br/>
                     <i>Select: </i><input type='radio' name='imagebase' value='$file' />
                   </td>";
                $action++;
                if ($action == $columns){
                    $action = 0;
                    echo "</tr>";
                }
              }
        }

        echo "</tr>";


    }    
}

?>

Link to comment
https://forums.phpfreaks.com/topic/181408-adding-pagination-guidance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.