| |
Stuff2Do Elite Googler

Joined: 10 Nov 2004 Location: England, UK 790.60 GC$
Items
|
Posted: Fri Apr 08, 2005 4:02 pm Post subject: php help :( |
|
|
|
i just started learning php, im stuck on a problem, this script picks up all folders in a directory, the only problem being, its only picking up scripts in root, i dont want that, i only want it picking folders up in the /pages directory, any ideas?
| Code: |
<?
$rep=opendir('.');
$bAuMoinsUnRepertoire = false;
while ($file = readdir($rep)){
if($file != '..' && $file !='.' && $file !=''){
if (is_dir($file)){
print("<a href='$file/index.php'>$file</a>");
print("<BR>");
}
}
}
{
}
?>
|
i either need this working, or a php-code that detects php files and makes a link to the file, or a code that detects folders, but in a directory, like /pages, HELP!!!! lol |
|
| Back to top |
|
|
geekerati Google elgooG


Joined: 17 Jan 2005 Location: Deep in the heart. 21217.12 GC$
Items
|
Posted: Sun Apr 10, 2005 10:00 pm Post subject: |
|
|
|
Maybe this thread should be locked now, since he's no longer here to reply or read it. _________________
  |
|
| Back to top |
|
|
Termina Noogle

Joined: 03 May 2005 Location: Wisconsin 176.55 GC$
Items
|
Posted: Wed May 04, 2005 9:23 pm Post subject: |
|
|
|
I was a bit confused by your post, but perhaps you're looking for something like this?
| Code: |
<?
$hubDir = '/home';
foreach(glob("$hubDir/*") as $filename)
{
if( is_dir($filename) && is_file("$filename/.plan") )
{
$username = explode("/",$filename);
$username = $username[count($username)-1];
$filedata = file_get_contents("$filename/.plan");
echo "<a href='~$username'>$username</a><br />$filedata<br /><br />";
}
}
?>
|
This is a script I made awhile back. It looks in /home, gets each foldername, as well as the contents of /home/user/.plan, and generates some HTML output. |
|
| Back to top |
|
|
puccavn Noogle

Joined: 12 Apr 2005
1021.15 GC$
Items
|
Posted: Thu May 05, 2005 11:57 pm Post subject: |
|
|
|
| post your error. I will help !! |
|
| Back to top |
|
|
Sponsored Links
|
Posted: 5 Dec 2008 10:01 am Post subject: Advertisements |
|
|
|
|
|
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Host your free forums with Invision Plus.net forum web hosting with your own subdomain.
alexisBlue v1.2 // Theme Created By: Andrew Charron // Icons in Part By: Travis Carden
|
|
|
|
|