Since this site was sold, the new owner of VirtualDN has lost interest. But I got a response from him! We're in talks right now.
Home
->
VirtualDN Forums
Help
Member Login
User:
Pswd:
Navigation
Frequently Asked Questions
New Account
Detailed Statistics
How vDN Works
Contact VirtualDN
Announcements
Since this site was sold, the new owner of VirtualDN has lost interest. But I got a response from him! We're in talks right now.
Welcome,
Guest
. Please
login
or
register
.
July 29, 2010, 11:35:50 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
New: WHOIS lookups also display the owner's REAL email address for easy communication outside of vDN if necessary.
10225
Posts in
1271
Topics by
522
Members
Latest Member:
Sancho Panza
Currently
0 users
are in the
Live Chat
. (Members only)
VirtualDN Forums
|
Virtual Web Development
|
Programming
| Topic:
PHP 'opendir'
0 Members and 0 Guests are viewing this topic.
« previous
next »
Pages:
[
1
]
Author
Topic: PHP 'opendir' (Read 623 times)
Mikor
Fresh Out of the Fridge
Domain Newcomer
Reputation: 9
Offline
Gender:
Posts: 491
vDNs Official Satanist
PHP 'opendir'
«
on:
April 20, 2006, 07:56:36 AM »
Here is my code:
<?php
function
readdirectory
(
$path
)
{
echo
"<table width=450 border=1 cellpadding=0 cellspacing=0><tr>"
;
if (!
file_exists
(
$path
)) echo
"not an existing directory"
;
if (!
is_dir
(
$path
)) echo
$path
.
" isnt a directory"
;
$main_dir
=
opendir
(
$path
) or die(
"Error reading "
.
$path
);
$i
=
0
;
while (
$entry
=
readdir
(
$main_dir
))
{
if(
filetype
(
$path
.
"/"
.
$entry
)==
"file"
) {
echo
"<td>"
.
$entry
.
"</td>"
;
echo
"<td><a href = \"./eBooks/"
.
$_GET
[
'c'
].
'/'
.
$entry
.
"\">View</a></td>"
;
echo
"<td>"
.
filesize
(
$path
.
"/"
.
$entry
).
" bytes</td>"
;
echo
"</tr><tr>"
;
}
}
echo
"</tr></td></table>"
;
}
if(isset(
$_GET
[
'c'
]) ==
true
){
$path
=
"./eBooks/"
.
$_GET
[
'c'
];
echo
'<b>Browsing Category '
.
$_GET
[
'c'
].
': </b><br><br>'
;
readdirectory
(
$path
);
}else{
echo
'Choose a category:<br>'
;
echo
'<a href = "browse.php?c=Magic">Magical Books</a><br>'
;
echo
'<a href = "browse.php?c=Lovecraft">Books written by Lovecraft (They are a bit random, so they get their own category)</a><br>'
;
}
?>
How can I make it display the files in alphabetical order? right now they're just displayed in any random order.
EDIT:
Replaced <tab>s with <space>s to make it more readable. I also changed the code a bit.
«
Last Edit: April 20, 2006, 03:27:16 PM by Mikor
»
Logged
Behold my Deviousness
The Necronomicon
Mikor
Fresh Out of the Fridge
Domain Newcomer
Reputation: 9
Offline
Gender:
Posts: 491
vDNs Official Satanist
Re: PHP 'opendir'
«
Reply #1 on:
April 20, 2006, 07:58:03 AM »
Its easier to see for yourself, heres the page:
http://mikor.clearlyhosted.net/eLibrary/browse.php?c=Magic
Logged
Behold my Deviousness
The Necronomicon
P10n33R
Fresh Out of the Fridge
Domain Newcomer
Reputation: 4
Offline
Gender:
Posts: 151
Re: PHP 'opendir'
«
Reply #2 on:
April 20, 2006, 10:44:07 AM »
Good way to get things done.
Logged
Mikor
Fresh Out of the Fridge
Domain Newcomer
Reputation: 9
Offline
Gender:
Posts: 491
vDNs Official Satanist
Re: PHP 'opendir'
«
Reply #3 on:
April 20, 2006, 11:08:07 AM »
I
was
asking how to make the files display in alphabetical order. Did you answer that? no.
lol
«
Last Edit: April 20, 2006, 11:17:15 AM by Mikor
»
Logged
Behold my Deviousness
The Necronomicon
P10n33R
Fresh Out of the Fridge
Domain Newcomer
Reputation: 4
Offline
Gender:
Posts: 151
Re: PHP 'opendir'
«
Reply #4 on:
April 20, 2006, 11:25:14 AM »
Well, if you talk like that I will not give you an answer.
Logged
Mikor
Fresh Out of the Fridge
Domain Newcomer
Reputation: 9
Offline
Gender:
Posts: 491
vDNs Official Satanist
Re: PHP 'opendir'
«
Reply #5 on:
April 20, 2006, 11:26:22 AM »
Im annoyed because everything im trying isnt working...
Logged
Behold my Deviousness
The Necronomicon
commes
Global Moderator
VirtualDN Contributor
Reputation: 15
Offline
Gender:
Posts: 1,333
This Spot And Avatar Area For Sale
Re: PHP 'opendir'
«
Reply #6 on:
April 20, 2006, 12:05:28 PM »
Quote from: P10n33R on April 20, 2006, 10:44:07 AM
Good way to get things done.
pioneer did you even read what he said?
Logged
Auto's For Sale
|
Electronics For Sale
|
Get the latest News Now!
Mikor
Fresh Out of the Fridge
Domain Newcomer
Reputation: 9
Offline
Gender:
Posts: 491
vDNs Official Satanist
Re: PHP 'opendir'
«
Reply #7 on:
April 20, 2006, 03:28:37 PM »
I dont think he did. I think he's just trying to get lots of posts, he has quite a lot of pointless posts.
Logged
Behold my Deviousness
The Necronomicon
Jakey
Fresh Out of the Fridge
Domain Hobbiest
Reputation: 8
Offline
Gender:
Posts: 743
Search.com
Re: PHP 'opendir'
«
Reply #8 on:
April 26, 2006, 11:38:01 PM »
Yeah I agree.
Logged
Search.com + Search.com Mail
vSearch.com
-
News.com
-
E-mail.com
-
VoIP.com
BrandonG
Fresh Out of the Fridge
Domain Hobbiest
Reputation: 12
Offline
Gender:
Posts: 560
vDN Idiot
Re: PHP 'opendir'
«
Reply #9 on:
April 27, 2006, 06:25:12 PM »
Same thing with Jakey LOL
I do the same, only a little bit though!
«
Last Edit: April 27, 2006, 06:25:33 PM by BrandonG
»
Logged
Free vDN$
compuXP
Administrator
Domain Hobbiest
Reputation: 18
Offline
Gender:
Posts: 914
VirtualDN Webmaster
Re: PHP 'opendir'
«
Reply #10 on:
April 30, 2006, 05:37:07 PM »
Actually, I've been wanting to know this for quite some time for users to browse veblo media files (real site) - thanks for this
Logged
NEW:
File a TM Request
and protect your brand name, slogan, or logo!
Tell everyone on your buddy list, forums, and friends about VirtualDN! The more the merrier, right?
Pages:
[
1
]
VirtualDN Forums
|
Virtual Web Development
|
Programming
| Topic:
PHP 'opendir'
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Domain Discussion
-----------------------------
=> Domains in General
=> Domain Name Appraisals
=> Available Names
=> Legalities & Domain Disputes
===> Filed Disputes and Court Cases
-----------------------------
Domain Booths
-----------------------------
=> Virtual Domain Market
=> Domains for Sale at Fixed Price/Offer
=> Domain Auctions
=> Developed Domains w/ Site For Sale
=> Wanted Domains
=> Advertising & Marketing
=> Other Game Dollar Transactions
-----------------------------
Virtual Web Development
-----------------------------
=> Programming
=> Web Development Requests & Offers
=> Contests
=> Website Reviews
=> Graphics Reviews / Discussion
=> Site Discussion
===> Site Ideas & Concepts
-----------------------------
Other Topics
-----------------------------
=> Off Topic
=> Site Support & Suggestions
=> Forum Games
=> Announcements