Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6865741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:05:31+00:00 2026-05-27T03:05:31+00:00

I have php code for list all .swf files in a folder. (The name

  • 0

I have php code for list all “.swf” files in a folder. (The name of the files is always:
“99-dd-mm-YY_HH-mm-ss.swf”, example: “01-19-06-2011_18-40-00.swf”.
When I have more than 500 files in the folder is complicated to see and to refresh the page.

I need paginate the list of files.

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title></title>
<script type="text/javascript">
function submitform()
{    
  document.myform.submit();
}
</script>
</head>
<body>
<form name="myform" action="some.php" method="post">
<?php
   echo "\n<br>\n";


echo "<a href='javascript:this.location.reload();' style='color: #000000; font-weight: normal'>Refresh</a></br>";
   echo "<tr>\n<td>\n<a href='javascript:javascript:history.go(-1)'>\n";
   echo "<img src='../../inc/img/back.png' alt='Back'";
   echo " border=0>\n";
   echo "<b>&nbsp;Back</b></a></td>\n";
   echo "\n</tr>\n";
   echo "\n<br>\n\n<br>\n";
$folder='.';
function order($a,$b){
global $folder;
$directory='.';
return strcmp(strtolower($a), strtolower($b));
}
$folder=opendir($folder);
while($files=readdir($folder)){

$ext = pathinfo($files, PATHINFO_EXTENSION);
if ($ext == 'swf')  {  //con esta línea saco el nombre index.php del listado
$file[]=$files;
usort($file, "order");
}
}
$n = 0;
foreach($file as $archiv){
   $n = $n + 1;
   $day = substr($archiv, 3,10);
   $day = str_replace("-","/", $day);
   $hour = substr($archiv, 14,8);
   $hour = str_replace("-",":", $hour);
   echo "<img alt='Ver $archiv' src='../../inc/img/video.png'> Video $n, Día: $day, hour: $hour\n ";
   echo "<input type='submit' name='xxx' value='$archiv'></td>\n";
   echo "\n</tr>\n";
   echo "<br>";
}
closedir($folder);
   echo "\n<br>\n";
   echo "<tr>\n<td>\n<a href='javascript:javascript:history.go(-1)'>\n";
   echo "<img src='../../inc/img/back.png' alt='Back'";
   echo " border=0>\n";
   echo "<b>&nbsp;Back</b></a></td>\n";
   echo "\n</tr>\n";
?>
</form>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:05:32+00:00Added an answer on May 27, 2026 at 3:05 am

    I used this code for simple pagination

    <?php
    // Include the pagination class
    include 'pagination.class.php';
    // Create the pagination object
    $pagination = new pagination;
    
    // some example data
    foreach (range(1, 100) as $value) {
    $products[] = array(
    'Product' => 'Product '.$value,
    'Price' => rand(100, 1000),
    );
    }
    
    // If we have an array with items
    if (count($products)) {
    // Parse through the pagination class
    $productPages = $pagination->generate($products, 20);
    // If we have items
    if (count($productPages) != 0) {
    // Create the page numbers
    echo $pageNumbers = '<div>'.$pagination->links().'</div>';
    // Loop through all the items in the array
    foreach ($productPages as $productID => $productArray) {
    // Show the information about the item
    echo '<p><b>'.$productArray['Product'].'</b> 243'.$productArray['Price'].'</p>';
    }
    // print out the page numbers beneath the results
    echo $pageNumbers;
    }
    }
    ?>
    

    Here there is pagination class and the example for download:
    http://lotsofcode.com/php/php-array-pagination.htm

    Thanks for all!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code will list all the file in a directory <?php if ($handle
I have made a php image gallery, which should list all the subdirectories of
Possible Duplicate: List all folders on my computer (php) I have tried: $handle =
I have this php code, with which I am trying to generate a popup
I have this PHP code echo '<a href=# onclick=updateByQuery(\'Layer3\', ' . json_encode($query) . ');>Link
I have some PHP code that generates dynamic tables of data on the fly.
I have some PHP code that is designed to make a spreadsheet with formulas
I have some PHP code that generates a calendar and then outputs html to
I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
I have this php code $jsonArray = array(); $sql = SELECT ID,CLIENT FROM PLD_SERVERS;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.