€
€ - EUR
$ - USD
Deutsch
Englisch
Login
Username / E-Mail
Password
Stay logged in?
Login
Are you new here?
Forgot password?
You don't have an account yet?
Become part of our PHP community and register now...
Register now
Toggle navigation
Home
PHP Scripts
PHP Scripts
Free PHP Scripts
CMS Content Management Systems (507)
CMS Content Management Systems (507)
Open Source Content Management Systems with PHP (507)
Blog and Editorial Systems (213)
CMS Systems (170)
Forum Software (85)
SaaS Website builder tool
Social-Network Systems (39)
PHP-Scripts (1823)
PHP-Scripts (1823)
We offer high quality and free PHP scripts that will help you to make your website more successful. Find the perfect PHP script for your PHP project! (1823)
User Management & Authentication with PHP (18)
Image Handling & Processing (115)
Image & Video-Gallery (11)
Machine Learning with PHP (3)
Education & E-Learing (1)
Chats & Communication tools (56)
Clone Scripts (5)
Domains & Hosting (70)
Financial Tools & Analysis
Graphs & Charts (13)
Guestbooks (153)
Calendar and time management (37)
Mailer (209)
Online Games & Entertainment (33)
PDF (15)
Text recognition & OCR (1)
Rich Text & Drag and Drop Editor (10)
Script extensions (97)
PHP SEO Scripts (1)
Security with PHP (87)
Social Networking (7)
Search Engines (61)
Polls & Voting (30)
Perimeter search with PHP (3)
Directories (144)
Web Radio & Music-Streaming (4)
Webmastertools (36)
Advertising & Banner Management (69)
Weather forecast (1)
Other PHP scripts (533)
Coding Tools (235)
Coding Tools (235)
Find the best tools for PHP software developers. (235)
Code snippets and classes (163)
Development Environments IDE (11)
PHP Frameworks (11)
PHP Scripts for mySQL (41)
SQL-RDBMS Editors (6)
Version control system (Git) (3)
E-Commerce (393)
E-Commerce (393)
PHP scripts that allow you to create a professional online store, online marketplace or classifieds marketplace. (393)
Licensing Systems (6)
Auction software (36)
Ordering & Delivery
Accounting systems (6)
Business & Company Directories (2)
Classifieds Software (1)
Marketplace Software (94)
Onlineshop Software (150)
Affiliate Programs (98)
Project- & Customer-Management (29)
Project- & Customer-Management (29)
Successfully manage projects and customers with our powerful PHP scripts (29)
FAQ systems (10)
Groupware Tools (12)
Projektmanagement Software (1)
Ticket- & Supportsystems (5)
PHP CRM Systems (1)
SEO-Tools & Marketing (179)
SEO-Tools & Marketing (179)
SEO Tools, Evaluations & Marketing (179)
AI-supported text generation (3)
SEO Controlling Tools (4)
Web Traffic & User Analysis (172)
Webdesign (19)
Webdesign (19)
Free image databases, Web-Themes and more (19)
Free Image databases (19)
Themes
JavaScript (83)
JavaScript (83)
JavaScript Frameworks and JavaScript Libraries (83)
JS Frameworks (4)
JS Programme & Libraries (79)
Webhosting (1)
Webhosting (1)
Server, web packages, Domains and cloud services (1)
Domains
Server (1)
Webhosting Control Panel
Shared Hosting
Cloud-Services
PHP-Forum
Agencies & Freelancers
Agencies & Freelancers
Full Service Internet Agency (2)
Media Design (1)
Copywriter & Contenwriter (1)
Web & Software Development Agencies (5)
Webhosting & IT-Service (1)
SEA , SEM and SEO Agency (1)
Web-Developer & Freelancer (17258)
Job offers & Project Tenders
Job offers & Project Tenders
Project tenders
Project tenders
Project tenders
Development Projects (9)
Job Vacancies (231)
Job Vacancies (231)
PHP Programmers Wanted - Job Postings and Career Opportunities for PHP Developers (231)
Apprenticeship positions
Internships
Permanent position (231)
Post a Project
Post a Project
Receive offers from qualified developers and agencies
Have a website or online shop created
Have an internet project created
Website maintenance and support
Magazin & Tutorials
Magazin & Tutorials
Magazin & PHP Tutorials
PHP Magazin
PHP Magazin
PHP Magazin
Software & Web-Development (740)
Software-Updates (11)
Hosting & Technology (3)
SEO & Online-Marketing (5)
Company News and Press Releases (1)
Miscellaneous (117)
Tutorials
Tutorials
Tutorials for web developers
PHP-Tutorials (40)
mySQL-Tutorials (10)
SEO Tutorials (1)
Linux & Server Tutorials (6)
Other tutorials (5)
KI Tutorials (1)
PHP & Co.
PHP & Co.
Informationen zu Scriptsprach PHP
PHP
PHP
Open source scripting language PHP simply explained
Introduction to PHP
PHP-Frameworks
Development Environments
Object-oriented programming in PHP
PHP Manual
MySQL
MySQL
relational databases MySQL/MariaDB and PHP
SQL-RDBMS Editors
Mysql vs. MariaDB
×
Loading... Please wait.
Heutige Beiträge
Benutzerliste
Search in titles only
Search in PHP Developer Forum only
Search
Advanced Search
Forum
Entwicklung
PHP Developer Forum
Dateien eines Verzeichnisses anzeigen
Collapse
X
Collapse
Posts
Latest Activity
Photos
Search
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Andi22
Newbie
Join Date:
Apr 2001
Posts:
67
Share
Tweet
#1
Dateien eines Verzeichnisses anzeigen
19-10-2001, 07:53
Hallo,
ich will mit PHP von einem Verzeichnis die darin enthaltenen Dateinamen ausgeben lassen. Wie funktioniert das?
hannes
PHP-Süchtiger
Join Date:
May 2001
Posts:
200
Share
Tweet
#2
19-10-2001, 08:10
<?
function DirToArray($sPath){
global $depth;
$handle = opendir($sPath);
while($arrDir[] = readdir($handle)){ }
closedir($handle);
sort($arrDir);
foreach($arrDir as $file){
if(!ereg("^\.", $file) and strlen($file)){
if(is_dir($sPath."/".$file)){
echo str_repeat("-", $depth);
echo "+ <".$file"><br>";
depth++;
DirToArray($sPath."/".$file);
depth--;
}else{
echo str_repeat("-", $depth);
echo " ".$file;
}
echo "<br>";
}
}
return $arrDir;
}
$depth = 1;
$path = "../"; //Startpunkt
echo "<pre>";
$arrDir = DirToArray($path);
?>
Dieser Code zeigt auch unterverzeichnisse und deren Dateien an !
Comment
Post
Cancel
Webbby22
Newbie
Join Date:
Oct 2001
Posts:
13
Share
Tweet
#3
22-10-2001, 19:46
...oder doch nicht?
Bei mir gehts nicht, da kommt nur die Meldung:
---
Parse error: parse error, expecting `','' or `';'' in /home/username/www/test/dir.php on line 12
---
username = mein username, also OK!
Whats wrong?
Bye & THX
~~ Webbby22 ~~
Comment
Post
Cancel
andreh
Newbie
Join Date:
Aug 2001
Posts:
14
Share
Tweet
#4
22-10-2001, 22:11
11 echo str_repeat("-", $depth);
12
echo "+ <" . $file "><br>";
13 depth++;
14 DirToArray($sPath."/".$file);
15 depth--;
da ist der fehler drin.. es muss heissen:
11 echo str_repeat("-", $depth);
12 echo "+ <" . $file
.
"><br>";
13 $depth++;
14 DirToArray($sPath."/".$file);
15 $depth--;
bitte bitte
so, hatte noch die $ vergessen
[Editiert von andreh am 23-10-2001 um 00:25]
Comment
Post
Cancel
Webbby22
Newbie
Join Date:
Oct 2001
Posts:
13
Share
Tweet
#5
22-10-2001, 22:49
Ich check's net... ;-(
Danke, hab jetzt den fehler:
---
Parse error: parse error in /home/username/www/dir.php on line 13
---
Aber kann ich das überhaupt so aufrufen? Ich denk nicht. Da ich ein Newbie bin, bitte wie ruf' ich diese Datei dann korrekt auf..??
THX & BYE
~ WEBBBY22 ~
Comment
Post
Cancel
Titus
PHP Master
Join Date:
Jan 2001
Posts:
4292
Share
Tweet
#6
23-10-2001, 17:47
13 $depth++;
---^ ohne Dollar ist das kein Variablenname
mein Sport:
mein Frühstück:
meine Arbeit:
Sämtliche Code-Schnipsel sind im Allgemeinen nicht getestet und werden ohne Gewähr auf Fehlerfreiheit und Korrektheit gepostet.
Comment
Post
Cancel
bohni
Member
Join Date:
Oct 2001
Posts:
423
Share
Tweet
#7
24-10-2001, 11:10
Tach!
probiers mal damit:
<?php
$handle=opendir ('.');
while (false !== ($file = readdir ($handle))) {
echo "$file\n";
}
closedir($handle);
?>
Hier wird das aktuelle Verzeichnis, in dem du dich befindest ausgegeben. Um anderes Verzeichnis anzuzeigen, einfach andren handle angeben. Weiteres im PHP-Handbuch von php.net
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
X
Comment