0

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?

4
Contributors
6
Replies
7
Views
4 Years
Discussion Span
Last Post by freakvista
0

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.

0

@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.

Edited by LastMitch: grammer

0

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.

0

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?

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.