What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » including entire folders with php

including entire folders with php
Author: Message:
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. including entire folders with php
is it possible to include entire folders using php... so if i had index.php and i wanted to include all the files in the firectory http://url/php/ would i be able to do so? or is it only possible to only include seperate files?? Thanks
formerly methos
07-11-2006 12:01 PM
Profile PM Web Find Quote Report
Veggie
Full Member
***

Avatar

Posts: 415
Reputation: 21
37 / Male / Flag
Joined: Sep 2004
RE: including entire folders with php
use your head, get all the files in the dir then loop through them:

PHP 5
http://uk.php.net/manual/en/function.scandir.php
07-11-2006 12:09 PM
Profile E-Mail PM Web Find Quote Report
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. RE: including entire folders with php
quote:
Originally posted by Veggie
use your head, get all the files in the dir then loop through them:

PHP 5
http://uk.php.net/manual/en/function.scandir.php

oh cool, awesome, sorry, i've only just started to learn php... thanks :happy:
formerly methos
07-11-2006 12:22 PM
Profile PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: including entire folders with php
insecurity alert...
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
07-11-2006 12:23 PM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: including entire folders with php
quote:
Originally posted by Veggie
use your head, get all the files in the dir then loop through them:

PHP 5
http://uk.php.net/manual/en/function.scandir.php
pfft directory iterators \o/

code:
foreach($dir = new DirectoryIterator("./includes") as $file){
if($dir->isFile() && strrchr($file, ".") == ".php")include($dir->getPathname());
}



This post was edited on 07-11-2006 at 12:34 PM by -dt-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-11-2006 12:25 PM
Profile PM Web Find Quote Report
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. RE: including entire folders with php
quote:
Originally posted by ShawnZ
insecurity alert...
eh?
quote:
Originally posted by -dt-
pfft directory iterators \o/
:S
*looks up directory iterators*
formerly methos
07-11-2006 01:07 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On