
TRI0N
Members-
Posts
215 -
Joined
-
Last visited
Everything posted by TRI0N
-
Thats the results filter but not the file handler. Is ther more that is used to determine where it may be having a fault.. I'm supprised for one that it works in Firefox and not IE.. Firefox is pretty strict about what it shows people compared to IE.
-
I incluced that it's the 2nd line down of the PHP Code... $path... So from root lets say you want to look at the files in /docs $path = "./docs"; // path to the directory to read ( ./ reads the dir this file is in) Simple stuff...
-
Well anyways I'm assuing you just want to show text files (*.txt) so here is a something I use to do this.. I also included a commented line so that if you need to show more then just .txt you can and it will hide .php file that might be in that dir. Bonus it shows last modified date and MD5 Checksum. Have fun! <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset="iso-8859-1"> <link rel="stylesheet" type="text/css" href="../global.css"> <title>Greenskeeper.org :: Event Tracker</title> <style fprolloverstyle>A:hover {color: #FF0000} </style> </head> <?php $path = "./"; // path to the directory to read ( ./ reads the dir this file is in) if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { // if($file != "." && $file != ".." && strrchr($file, ".") != ".php") { if($file != "." && $file != ".." && strrchr($file, ".") == ".txt") { if(!is_dir($file)){ $item[] = $file ; $file_size = round(filesize($file)/1024,2) ; if($file_size >= 1024){ $filesize[] = "File Size: ".round($file_size/1024,2) ; $file_xb[] = " MB" ; } else { $filesize[] = "File Size: ".round(filesize($file)/1024,2) ; $file_xb[] = " KB" ; } $filectime[] = "Last Modified: ".date("d/m/Y G:i:s",filectime($file)) ; // set last changed date $md5[] = md5_file($file) ; $md5tag[] = "<font color='#FF0000'>MD5</font>: " ; } } } closedir($handle); } $total_items = count($item); $max_items = ceil($total_items / 3); // items per <td> $start = 0; $end = $max_items //generate the table ?> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr><p> <?php for($i=0; $i<3; $i++){ if($i != 0){ $start = $start + $max_items; $end = $end + $max_items; } echo "<td><p>"; for($x = $start; $x < $end; $x++){ // display the item echo '<a href = "'.$path.$item[$x] .'">' ; echo $item[$x]."</a><br>" ; echo $filesize[$x].$file_xb[$x]."<br>" ; echo $filectime[$x]."<br>" ; echo $md5tag[$x].$md5[$x]."<br><br>" ; } echo "</p></td>"; } ?> </p></tr> </table>
-
Do you only want to display .txt files in it?
-
$path = "./"; // path to the directory to read ( ./ reads the dir this file is in) if ($handle = opendir($path)) { Not the complete script but an Idea that should help you figure out how to get opendir($path) into yours.
-
Very Nice.. Thanks.. Never had to play with anything like that before.. hehe
-
Never had to use a wildcard before except for Database ones but here is the code. I want it to filter out a few things and want to create a wildcard for Adobe Illistrator files *.ai in this directory but can view everthing else in the dir which are all Adobe Acrobat files *.pdf and I already have it ignoring the index.php so that it doesn't list in the directory listing. Right now it shows all *.ai and *.pdf files. What do I use to filter out *.ai files? if($file != "." && $file != "index.php" && $file != "..") { Thanks to anyone that can tip me on this.. I tried % like you would for MySQL, * like almost anything uses, and _ like 1 character wildcard of MySQL and all of them don't do the gig.
-
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
Add code? What code? But later you might want to add it to mater temple if you had code to add. -
If you want to add a little MD5 to it I added this so that it would checksum each file with a MD5 Hash to verify that its what they got from you. <?php $path = "./"; // path to the directory to read ( ./ reads the dir this file is in) if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(!is_dir($file)){ $item[] = $file; $md5[] = md5_file($file); $md5tag[] = "MD5 Checksum: "; } } } closedir($handle); } $total_items = count($item); $max_items = ceil($total_items / 3); // items per <td> $start = 0; $end = $max_items //generate the table ?> <table width="100%" border="1" cellspacing="0" cellpadding="2"> <tr> <?php for($i=0; $i<3; $i++){ if($i != 0){ $start = $start + $max_items; $end = $end + $max_items; } echo "<td>"; for($x = $start; $x < $end; $x++){ // display the item echo '<a href = "'.$path.$item[$x] .'">'; echo $item[$x]."</a><br>"; echo $md5tag[$x].$md5[$x]."<br>"; } echo "</td>"; } ?> </tr> </table>
-
Another Simple one: <?php $path = "./"; // path to the directory to read ( ./ reads the dir this file is in) if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(!is_dir($file)){ $item[] = $file; } } } closedir($handle); } $total_items = count($item); $max_items = ceil($total_items / 3); // items per <td> $start = 0; $end = $max_items //generate the table ?> <table width="100%" border="1" cellspacing="0" cellpadding="2"> <tr> <?php for($i=0; $i<3; $i++){ if($i != 0){ $start = $start + $max_items; $end = $end + $max_items; } echo "<td>"; for($x = $start; $x < $end; $x++){ // display the item echo '<a href = "'.$path.$item[$x] .'">'; echo $item[$x]."</a><br>"; } echo "</td>"; } ?> </tr> </table>
-
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
Most certianly! -
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
Firefox is more strict about codes.. While others are relaxed on them and read color codes without # in from of them which is wrong based on W3C guidlines.. The # is there for a reason. -
No no no its not using FTP.. It shows you the DIR thru your browser... I thought you ment "Like" ftp.. But it is no way FTP.. The way I say is if you make a link to your DIR with the .htaccess file in it.. It will just show them that directory as long as no htm, asp, php, html, shtml - index page is it in.. It just show you the dir as is with files and sub directories if they exist. Click a file in it and it will download. Just try it and if you don't like it delete the .htaccess file and you are back to square one.
-
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
Nothing if your not using it to extract data from a database or to minipulate or code working objects into a page. If your just making pages with layouts then PHP isn't going to do anything for you. -
Yeah kind of.. Just list what you have in a dir and people can just download form it.. If you want to do it so it does what Paul was takling about then its up to you... Pick your flavor..
-
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
No #FFFFFF is white.. #FFF is an invalid color. -
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
<body bgcolor="B1BEA3"> to <body bgcolor="#B1BEA3"> -
web page in php has no background color in firefox
TRI0N replied to Visualanté's topic in PHP Coding Help
Well #FFF isn't a color... Did you want Blue? If so then #000FFF. -
Get Shogun's Recomendation.. WinRar does cost money..
-
Get WinRar.. Winzip does not support Rar or Tar... WinRar supports Rar, Tar and Zip.
-
Open up a text editor. If windows use Wordpad... Save the file right off as .htaccess into the dir that is the download dir. Or someplace on your computer if you need to upload it via FTP... Now inside the .htaccess put this. Options +Indexes Save. Upload if needed.. Make sure it is only in the dir that you want users to browse... Then viola your set... To make things a bit more safe make another .htaccess and this time put it in the parent directory ".." Options -Indexes This way if anyone clicks Parent Directory they won't get to see anything like the download dir.. They will either get a 404 error or the index.php,html,htm will load.
-
Woundln't it just be easier to make a .htaccess file and allow directory browsing for the download dir?
-
how to get the value from the database to the checkbox
TRI0N replied to pixeltrace's topic in PHP Coding Help
Again your still looking at just j_type in your query. You don't have any other j_type.. Your database needs j_type1 j_type2 j_type3 so that you can then assign those to the other 2 check boxes. You are looking at j_type and lets say its Part Time then only Part Time will show up checked. -
[SOLVED] MySQL Out Put Data Name Change Using PHP
TRI0N replied to suttercain's topic in PHP Coding Help
I'm assuming $row['vehicle'] is where the ARC TOY etc is... if($row['vehicle'] == "ACR") { $make = "Accura" ; } else if { $row['vehicle'] == "TOY") { $make = "Toyota" ; } else { $make = "Audi" ; } } Place that right before your $class then echo $make where you want it to show the name. -
how to get the value from the database to the checkbox
TRI0N replied to pixeltrace's topic in PHP Coding Help
Look at your input check boxes you have the varibles all wrong.. You have "j_type_ck1" When you defined the varble to be "j_type1_ck"