So i want to show all the files from a certain folder all in one collumn(i think i am going to use table for this) and in the second collumn i want a square, and if you click on it to put the marked thing over. Or i need to use pictures for this?

Recommended Answers

All 6 Replies

No idea what you mean... I get thye folder in one coloumn part, the second part "square" and then marked thing... no idea.

We will not know if pictures is better because you need to give us much more information.

Member Avatar for LastMitch

@freakvista

So i want to show all the files from a certain folder all in one collumn(i think i am going to use table for this) and in the second collumn i want a square, and if you click on it to put the marked thing over. Or i need to use pictures for this?

You are talking about how to align images in a first column right? Then you want the second column to be a square so you can add a image in it? Do you have a code for this if so can you post it so we can see it.

Nonono i was talking about checkboxes. So this is my code, but it doesn't show any file(although there are files)

$dir ="countries/$folder/$sfolder";

echo "<form method='POST' name='MyForm'>";
echo "<table>";
echo "<tr width='300px'><th colspan='3' align='center'> $folder : $sfolder <br /><br /></th>";
echo "</tr>";
echo    "<tr>
            <td align='center'> File </td>
            <td align='center'> Delete </td>
        </tr>";
foreach(glob($dir.'*.*') as $v){
    echo "<tr>
            <td> $v </td>
            <td> <input type='checkbox' name='x'/>&nbsp;<br /> </td>
          </tr>";
}
echo "  <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td><br /><input type='submit' value='Delete' onclick='CheckCheckboxes()'/></td>
        </tr>";
echo "</table>";
echo "</form>";

$folder and $sfolder and known, i didn't put all my code, but all i want is this part right here to work.

ok

foreach(glob("$dir/*.[jJ][pP]*[gG]", GLOB_BRACE) as $v){
    echo "<tr>
            <td> $v </td>
            <td> <input type='checkbox' name='x'/>&nbsp;<br /> </td>
          </tr>";
}

how can i make sure it echos only the name? not the whole $dir?

Member Avatar for diafol

Didn't I post this in your other thread?

foreach(glob("countries/{USA,Brazil,UK,India}/{subfolder1,subfolder2,subfolder3}/*.[jJ][pP]*[gG]", GLOB_BRACE) as $r){
    $b = basename($r);
    echo "<img src='$r' alt = '$b' /><br />"; 
}

$b will show just the filename.

Uops sorry. Thank you again!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.