Jump to content

joshd963

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

joshd963's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. "top nutter" Thanks a lot for your help :-) it now works, & i understand. Cheers
  2. also should the 1 and 2 be in '' ie '1' or '2' correct me if im wrong
  3. your code: <?echo"$username";?> new code: <?php echo "$username"; ?> if that doesnt work... are you passing the title through POST? if so.. you will need to set the variable first.. ie.. $username = $_POST['username']; Josh
  4. Hi guys. Just a quick PHP question. I have a script running that gets the files from a directory. There is then a switch function that decides what to do with the file, ie... if it is a PNG... DO THIS.. if it is a docx... DO THIS.. etc. And i want each file to be in a different cell on the table. The table can be longer wider than 5 columns (however it can be as high as it wants). I currently have this bit working... but instead of one item in each cell... it is displaying every item in each cell. Any ideas Chaps? Here is my code Many thanks in advance if you could possibly help.. echo "<table><tr>"; $count = count(glob("../../shared/files/*.*", GLOB_BRACE)); for($i=1; $i <= $count; $i++) { /// echo "<td>"; /// if ($handle = opendir('../../shared/files/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $break = pathinfo($file); $b = $break['extension']; switch (@$break[extension]) { case 'bmp' : echo 'A BMP<br>'; break; case 'png' : echo 'A PNG<br>'; break; case 'doc' : case 'docx' : echo 'A DOC OR DOCX<br>'; break; default: echo 'FILE NOT RECOGNISED<br>'; } } } closedir($handle); } /// echo "</td>"; /// if($i % 3 == 0) echo "</tr><tr>"; } echo "</tr></table>"; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.