Google Community Chat
 
php help :(

You're visiting Google Community as a guest.
In order to post, you'll need to register and log in.


(If you were registered and logged in, these advertisements wouldn't be here)
Post new topic   Reply to topic    Google Community Forum Index // Web Design, Coding & Programming Forum
   
Author Message
Stuff2Do
Elite Googler
Elite Googler


Joined: 10 Nov 2004
Location: England, UK
790.60 GC$

Items

PostPosted: Fri Apr 08, 2005 4:02 pm    Post subject: php help :( Reply with quote
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
geekerati
Google elgooG
Platinum Member


Joined: 17 Jan 2005
Location: Deep in the heart.
21217.12 GC$

Items

PostPosted: Sun Apr 10, 2005 10:00 pm    Post subject: Reply with quote
Maybe this thread should be locked now, since he's no longer here to reply or read it.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Termina
Noogle
Noogle


Joined: 03 May 2005
Location: Wisconsin
176.55 GC$

Items

PostPosted: Wed May 04, 2005 9:23 pm    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website AIM Address
puccavn
Noogle
Noogle


Joined: 12 Apr 2005

1021.15 GC$

Items

PostPosted: Thu May 05, 2005 11:57 pm    Post subject: Reply with quote
post your error. I will help !!
Back to top
View user's profile Send private message
Sponsored Links
Posted: 9 Jan 2009 3:13 am    Post subject: Advertisements
Back to top
Post new topic   Reply to topic    Google Community Forum Index // Web Design, Coding & Programming Forum All times are GMT - 8 Hours
Page 1 of 1


 
Jump to:  
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

© 2005-2006 Google Community

Powered by phpBB

Privacy Policy | Contact Us

Powered by Google Search blog

This website is not affiliated in any way with Google, Inc.
Google™ is a registered trademark of Google, Inc.