Einzelnen Beitrag anzeigen
  #1  
Alt 28.02.2006, 20:20:30
silent.chiller silent.chiller ist offline
Anfänger
 
Registriert seit: Feb 2006
Beiträge: 4
nach if, html tags, und zwischen html tags php befehle...?

Hy, wie kann ich diesen code(listet alles files in einem bestimmten ordner auf):
PHP-Code:
<?php

   $path 
$_GET["path"];
   if( !isset( 
$path ) || $path == "" )  {
     
$path "./";
   }

   print 
"";

   
# Initialise list arrays, directories and files separately and array counters for them
   
$d_arr = array(); $d 0;
   
$f_arr = array(); $f 0;

   if( 
is_dir$path ) ) {
     if( 
$handle opendir$path ) ) {
         while( 
false !== ( $file readdir$handle ) ) ) {

           if( 
$file != "." && $file != ".." && $file[0] != "." ) {
               if( 
is_dir$path "/" $file ) )

                 
$d_arr[$d++] = $file;
               else

                 
$f_arr[$f++] = $file;
           }
         }
     }
   }


   if( 
is_dir$handle ) ) closedir$handle );


   
asort$d_arr ); reset$d_arr );
   
asort$f_arr ); reset$f_arr );


   
$d_prev substr$path0, ( strrposdirname$path "/." ), "/" ) ) );
   print 
"<div align='left'><a href=\"?path=" $d_prev "\"> Parent directory </a><br>\n";


   for( 
$i=0$i count$d_arr ); $i++ ) {

     print 
"<a href=\"?path=" $path "" $d_arr[$i] . "\">" $d_arr[$i] . "</a><br>\n";
   }
   
   print 
"<table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
   for( 
$i=0$i count$f_arr ); $i++ ) {

  print 
"<tr>
    <td><a href=\"" 
$path "" $f_arr[$i] . "\"> " $f_arr[$i] . "</a></div></td>
    <td width='45%' valign='bottom'><div align='right'>"
;

     if( 
filesize$path "/" $f_arr[$i] ) >= 1024 ) {

         print 
roundfilesize$path "/" $f_arr[$i] ) / 1024) . " KB";
     } elseif( 
filesize$path "/" $f_arr[$i] ) >= 1048576 ) {

         print 
roundfilesize$path "/" $f_arr[$i] ) / 1024 1024) . " MB";
     } else {

         print 
filesize$path "/" $f_arr[$i] ) . " bytes";
     }
   print 
"</div>
     </td>
  </tr>"
;
   }
   
   print 
"</table><br>\n";

?>
in diesen tun?

PHP-Code:

<?php
if (file_exists("file1")) {
echo 
"



"
;
    } else {
            echo 
"";
        }

if (
file_exists("file2")) {
print 
"

<h3>File manager</h3>
<form id='your-profile'> <!-- just required to show fieldsets -->
<fieldset>
<legend>Existing Files</legend>

<!--  Hier sollte es rein... -->

</label>
</fieldset>

<fieldset>
<legend>Infos and Upload</legend>
bla bla bla
</fieldset>

<br clear='all' />
<fieldset>
<legend>Admin messages</legend>



</fieldset>

<br clear='all' />

</form>

"
;
    } else {
            echo 
"";
        }

if (
file_exists("file3")) {
echo 
"";
    } else {
            echo 
"";
        }

?>
Ich danke für jegliche Tipps mit dem ich es realisieren kann...

MFG
silent.chiller
Mit Zitat antworten