Results 1 to 2 of 2

Thread: Glob PHP Subdirectory

  1. #1
    Join Date
    Dec 2006
    Beans
    12

    Glob PHP Subdirectory

    can anyone help me? This is my code. I am new and not very good at all.

    <?
    while ($row = mysql_fetch_array($result))

    {
    echo "<br />";
    echo $row['mlsid'];
    echo "<br />";
    echo $row['address'];
    echo "<br />";


    foreach (glob($row['mlsid']."*101*") as $filename)
    {
    echo "<img height=100 width=100 src=".$filename.">";

    }

    }
    mysql_close($db_link);


    ?>

    It works great if I keep all the pictures in the same directory, but I want to put them in a subdirectory. It messes everything up.

    How do I glob into a subdirectory.

    Thank you,

  2. #2
    Join Date
    Nov 2008
    Location
    Here, There, Everywhere
    Beans
    1,165
    Distro
    Xubuntu

    Re: Glob PHP Subdirectory

    Try glob("**/".$row['mlsid']."*101*")

Tags for this Thread

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
  •