Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-06-2012, 01:34 AM   PM User | #1
soroze
New to the CF scene

 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
soroze is an unknown quantity at this point
How to List files from a folder with paging

Please give me a simple tutorial listing files with limit and paging!

Quote:
<?
$phpdir = "Files/";
$dir = opendir ($phpdir);
while ($file = readdir ($dir)) {
if (( $file != ".") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php") && ($file != "style.css"))
{
echo '<a href="'.$phpdir.$file.'">'.$file.'</a>';
}
}
?>
How can I make paging system with this that will show 10 files per page?
soroze is offline   Reply With Quote
Old 01-06-2012, 01:47 AM   PM User | #2
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,493
Thanks: 44
Thanked 438 Times in 427 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
The key word you should add to your google search is 'pagination'
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 01-06-2012, 10:09 AM   PM User | #3
soroze
New to the CF scene

 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
soroze is an unknown quantity at this point
Im not so smart bro!
I got pagination script but I dont know how to use it!
Please reply with a sample use
soroze is offline   Reply With Quote
Reply

Bookmarks

Tags
auto index, list file, paging

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:08 PM.


Advertisement
Log in to turn off these ads.