SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: php question

  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    U.S.
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php question

    hi,
    Could someone tell me how to put href code around the echo "(D)" or echo "$file<br>"?

    Thanks a lot!
    Code:
    <?php
    $dirname = "../gardenclub/";
    $directory = opendir($dirname) or die("couldn't open directory");
    
    while(!($file = readdir($directory)) === false){
    if(is_dir("$dirname/file")){
    echo "(D)";
    }
    echo "$file<br>";
    }
    closedir($directory);
    ?>

  2. #2
    SitePoint Wizard simplecode's Avatar
    Join Date
    Jun 2006
    Posts
    1,129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    is that wht u r looking for

    PHP Code:
    <?php
    $dirname 
    "../gardenclub/";
    $directory opendir($dirname) or die("couldn't open directory");

    while(!(
    $file readdir($directory)) === false){
    if(
    is_dir("$dirname/file")){
    echo 
    "<a href='link.html'>(D)</a>";
    }
    echo 
    "<a href='link.html'>$file</a>";
    }
    closedir($directory);
    ?>

  3. #3
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    U.S.
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •