Bob Norris Posted November 2, 2008 Share Posted November 2, 2008 Hi, A friend wrote this script for me a while back and I need to get the output to appear in tables. The output at the bottom is what I need to show in two side by side tables: echo $dirs[$k].' Shows the folder name and ----[ '.$v.' ] is the count foreach ($files as $k => $v) { echo $dirs[$k].' ----[ '.$v.' ] <br />'; } Right now it just prints on one line and is not centered or aligned. I would like to have the tables contain each information output. Thank you for your help! <html> <center><head> </head> <body> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin // Get today's current date. var now = new Date(); // Array list of days. var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); // Array list of months. var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); // Calculate the number of the current day in the week. var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); // Calculate four digit year. function fourdigits(number) { return (number < 1000) ? number + 1900 : number; } // Join it all together today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())) ; // Print out the data. document.write(today); // End --> </script> </html> <meta http-equiv="refresh" content="30" /> <br><p><?php $delete = $_REQUEST['delete']; if ($delete) { foreach (glob('*',GLOB_ONLYDIR) as $dir) { $file = $dir.'/bot2.log'; if (is_file($file)) { @unlink($file); } } } ?> <?php $dirs = array(); $files = array(); $i=0; foreach (glob('*',GLOB_ONLYDIR) as $dir) { $file = $dir.'/bot2.log'; if (is_file($file)) { $dirs[$i] = $dir; //$files[$i] = filesize($file); $files[$i] = sizeof(file($file))/2; ++$i; } } arsort($files); foreach ($files as $k => $v) { echo $dirs[$k].' ----[ '.$v.' ] <br />'; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.