SELFPHP: Version 5.8.2 Befehlsreferenz - Tutorial – Kochbuch – Forum für PHP Einsteiger und professionelle Entwickler

SELFPHP


Professional CronJob-Service

Suche



CronJob-Service    
bei SELFPHP mit ...



 + minütlichen Aufrufen
 + eigenem Crontab Eintrag
 + unbegrenzten CronJobs
 + Statistiken
 + Beispielaufrufen
 + Control-Bereich

Führen Sie mit den CronJobs von SELFPHP zeitgesteuert Programme auf Ihrem Server aus. Weitere Infos



:: Buchempfehlung ::

Handbuch der Java-Programmierung

Handbuch der Java-Programmierung zur Buchempfehlung
 

:: Anbieterverzeichnis ::

Globale Branchen

Informieren Sie sich über ausgewählte Unternehmen im Anbieterverzeichnis von SELFPHP  

 

:: Newsletter ::

Abonnieren Sie hier den kostenlosen SELFPHP Newsletter!

Vorname: 
Name:
E-Mail:
 
 

Zurück   PHP Forum > SELFPHP > PHP Grundlagen

PHP Grundlagen Hier kann über grundlegende Probleme oder Anfängerschwierigkeiten diskutiert werden

Antwort
 
Themen-Optionen Ansicht
  #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
  #2  
Alt 28.02.2006, 21:56:56
Usul Usul ist offline
Junior Member
 
Registriert seit: Jul 2004
Beiträge: 213
AW: nach if, html tags, und zwischen html tags php befehle...?

Soll das bei <!-- Hier sollte es rein... --> rein?

1. Weg mit dem printf. Statt dessen schliesse und oeffne den php-tag. ja, es ist ohne weiteres moeglich innerhalb einer php-schleife oder eine php-bedingung den php tag zu schliessen und mit normalen HTML weiterzumachen.

2. ersetze <!-- Hier sollte es rein... --> durch dein skript (inklusive php-tags)
__________________
Trapper: "This war is turning everybody into a criminal and it's making me sick."
Hawkeye: "Well next time try to stay out of the draft."
Mit Zitat antworten
  #3  
Alt 01.03.2006, 10:49:41
silent.chiller silent.chiller ist offline
Anfänger
 
Registriert seit: Feb 2006
Beiträge: 4
AW: nach if, html tags, und zwischen html tags php befehle...?

Ja es sollte bei "<!-- Hier sollte es rein... -->" rein :)
danke für die antwort.

Ich nehme mal an, du meintest das so, mit " php schliessen und mit " wieder öffnen... hab ich mal versucht:

PHP-Code:

<div class="wrap">
<h2>Own Files of <?php print($user_identity?></h2>
<?php
if (file_exists("check")) {
echo 
" ";
    } else {
            echo 
"";
        }

if (
file_exists("unlocked")) {
"
<h3>File manager</h3>
<form id='your-profile'> <!-- just required to show fieldsets -->
<fieldset>
<legend>Existing Files</legend>"

$path $_GET["path"]; #An dieser stelle gibts einen Fehler "Parse error: syntax error, unexpected T_VARIABLE in /wp-admin/ownfiles.php on line 36" Wie kann ich diesen fehler beheben?
   
if( !isset( $path ) || $path == "" )  {
     
$path "./";
   }

   print 
"";

   
$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"
"
</label>
</fieldset>

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

<br clear='all' />
<fieldset>
<legend>Admin messages</legend>
Hy, alle bla sind für blas zugaenglich, boe<br>
scheisse, über 20mb... $user_identity
</fieldset>

<br clear='all' />

</form>

"
;
    } else {
            echo 
"";
        }

if (
file_exists("../../members/$user_identity/locked")) {
echo 
" ";
    } else {
            echo 
"";
        }

?>

</div>

<?php include('admin-footer.php'); ?>
hmmm... Was habe ich falsch gemacht...?
Was ist gemeint mit T_VARIABLE?

mfg

mfg
Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind aus.
[IMG] Code ist aus.
HTML-Code ist aus.

Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
HTML Quelltext einer mit php Seite erzeugten Seite in .txt oder MySQL speichern. Berentzen PHP Grundlagen 2 14.06.2006 12:36:11
ins HTML includete PHP anpassen Camouflage PHP Grundlagen 1 16.01.2006 21:51:43
JSCode mit PHP gleichmässig im HTML Code verteilen Gagget PHP für Fortgeschrittene und Experten 4 14.11.2005 01:21:04
PHP wird in HTML Abschnitten/Dateien nicht erkannt Elderwolf PHP Grundlagen 6 09.04.2004 13:53:43
HTML seiten auf php ? Sh4rky Apache HTTP-Server 2 08.09.2003 12:17:35


Alle Zeitangaben in WEZ +2. Es ist jetzt 21:40:54 Uhr.


Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.


© 2001-2024 E-Mail SELFPHP OHG, info@selfphp.deImpressumKontakt