ich brauche Hilfe Mit einem Uptime script $end

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • ich brauche Hilfe Mit einem Uptime script $end

    das ist mein problem

    Parse error: parse error, unexpected $end in c:\program files\easyphp1-7\www\david\tes.php on line 73


    hier ist der script

    <?

    // The location of the pagefile.sys. Windowsdefault is c:\
    //$pagefile[] = "\\\pcci03\c$\pagefile.sys";

    $pagefile[0] = "\\\pcci03\c$\pagefile.sys";
    $pagefile[1] = "\\\pcci04\c$\pagefile.sys";

    // send the header of the page to the browser and begin the body
    // echo "$CSS<title>Sysinfo for $HTTP_SERVER_VARS[SERVER_NAME]</title></HEAD><BODY class=body>";


    for ($i=10; $i=10; $i++)
    {
    // Begin the first page with the general info ( just gather the info )

    //uptime
    $uptime = (time() - filemtime($pagefile[$i]));

    $weeks = floor($uptime / (7*(24*3600)) );
    $uptime = $uptime - ($weeks * (7*(24*3600)));

    $days = floor($uptime / (24*3600));
    $uptime = $uptime - ($days * (24*3600));
    $hours = floor($uptime / (3600));
    $uptime = $uptime - ($hours * (3600));
    $minutes = floor($uptime /(60));
    $uptime = $uptime - ($minutes * 60);
    $seconds = $uptime;
    if (!eregi("[0-9]{2}", $seconds)){
    $seconds = "0".$seconds;
    }
    if (!eregi("[0-9]{2}", $minutes)){
    $minutes = "0".$minutes;
    }
    if (!eregi("[0-9]{2}", $hours)){
    $hours = "0".$hours;
    }

    if($weeks == 1){
    $weeks = $weeks ." ".'week';
    }elseif($weeks == 0){
    $weeks="";
    }else{
    $weeks = $weeks ." ".'weeks';
    }

    if($days == 1){
    $days = $days ." ".'day';
    }elseif($days == 0){
    $days="";
    }else{
    $days = $days ." ".'days';
    }
    if($hours == 1){
    $hours = $hours ." ".'hour';
    }else{ $hours = $hours ." ".'hours';
    }
    if($minutes == 1){
    $minutes = $minutes ." ".'minute';
    }else{ $minutes = $minutes ." ".'minutes';
    }
    if($seconds == 1){
    $seconds = $seconds ." ".'second';
    }else{ $seconds = $seconds ." ".'seconds';
    }
    $theuptime = " ".$weeks." ".$days." ".$hours." ".$minutes." ".$seconds." ";

    //generate the general first html page and send it to the browser
    echo"<center><table><td valign=top>";
    echo"<table>";
    echo"<tr><td>System uptime ".substr($pagefile[$i], 2, 6)." :</td><td><span class=generatedinfo>".$theuptime."</span></td></tr></table></table><br>;
    }
    ?>

  • #2
    Ich glaube in deiner letzen Zeile beim echo fehlen die Anführungszeichen am Ende.

    Kommentar


    • #3
      danke jetzt habe ich ein weiters er macht mir eine un endliche schleife und dabei gib er ni die 2 pc aus die ich haben will danke

      Kommentar


      • #4
        du solltest Deine Bedingung nochmal überdenken. Du willst das ganze ja jeweols für die Einträge in $pagefile haben. Dann würde ich die for Schleife so machen for($i=0;$i<count($pagefile);$i++)

        Kommentar


        • #5
          <?

          // The location of the pagefile.sys. Windowsdefault is c:\
          //$pagefile[] = "\\\pcci03\c$\pagefile.sys";

          $pagefile[0] = "\\\pcci03\c$\pagefile.sys";
          $pagefile[1] = "\\\pc-ci-test-02\c$\pagefile.sys";

          // send the header of the page to the browser and begin the body
          // echo "$CSS<title>Sysinfo for $HTTP_SERVER_VARS[SERVER_NAME]</title></HEAD><BODY class=body>";


          for($i=0;$i<count($pagefile[$i]);$i++){

          // Begin the first page with the general info ( just gather the info )

          //uptime
          $uptime = (time() - filemtime($pagefile[$i]));

          $weeks = floor($uptime / (7*(24*3600)) );
          $uptime = $uptime - ($weeks * (7*(24*3600)));

          $days = floor($uptime / (24*3600));
          $uptime = $uptime - ($days * (24*3600));
          $hours = floor($uptime / (3600));
          $uptime = $uptime - ($hours * (3600));
          $minutes = floor($uptime /(60));
          $uptime = $uptime - ($minutes * 60);
          $seconds = $uptime;
          if (!eregi("[0-9]{2}", $seconds)){
          $seconds = "0".$seconds;
          }
          if (!eregi("[0-9]{2}", $minutes)){
          $minutes = "0".$minutes;
          }
          if (!eregi("[0-9]{2}", $hours)){
          $hours = "0".$hours;
          }

          if($weeks == 1){
          $weeks = $weeks ." ".'week';
          }elseif($weeks == 0){
          $weeks="";
          }else{
          $weeks = $weeks ." ".'weeks';
          }

          if($days == 1){
          $days = $days ." ".'day';
          }elseif($days == 0){
          $days="";
          }else{
          $days = $days ." ".'days';
          }
          if($hours == 1){
          $hours = $hours ." ".'hour';
          }else{ $hours = $hours ." ".'hours';
          }
          if($minutes == 1){
          $minutes = $minutes ." ".'minute';
          }else{ $minutes = $minutes ." ".'minutes';
          }
          if($seconds == 1){
          $seconds = $seconds ." ".'second';
          }else{ $seconds = $seconds ." ".'seconds';
          }
          $theuptime = " ".$weeks." ".$days." ".$hours." ".$minutes." ".$seconds." ";

          //generate the general first html page and send it to the browser
          echo"<center><table><td valign=top>";
          echo"<table>";
          echo"<tr><td>System uptime ".substr($pagefile[$i], 2, 13)." :</td><td><span class=generatedinfo>".$theuptime."</span></td></tr></table></table><br>";
          }

          ?>
          so sieht mein script für den moment aus aber ich bekomme jetzt keine ausgaben mehr

          Kommentar


          • #6
            $pagefile[0] = "///pcci03/c/pagefile.sys";
            $pagefile[1] = "///pc-ci-test-02/c$/pagefile.sys";

            der ///pcci03/c/pagefile.sys hat in apache funktioniert aber funktioniert nicht mehr in iis wie kann ich dan ändern hier ist die fehler meldung

            PHP Warning: filemtime(): Stat failed for //pcci03/c/pagefile.sys (errno=2 - No such file or directory) in c:\inetpub\wwwroot\david\tes.php on line 18 PHP Warning: filemtime(): Stat failed for //pc-ci-test-02/c$/pagefile.sys (errno=2 - No such file or directory) in c:\inetpub\wwwroot\david\tes.php on line 18
            Zuletzt geändert von myda; 01.06.2004, 15:00.

            Kommentar


            • #7
              Ich brauche hilfe mit netzwerk pfad in einem script

              Das sind die pfade


              PHP-Code:
              $pagefile[0] = "///pcci03/c/pagefile.sys";
              $pagefile[1] = "///pc-ci-test-02/c$/pagefile.sys"
              der ///pcci03/c/pagefile.sys hat in Apache funktioniert aber funktioniert nicht mehr in IIS wie kann ich dan ändern ??

              hier ist die fehler meldung

              PHP Warning: filemtime(): Stat failed for //pcci03/c/pagefile.sys (errno=2 - No such file or directory) in c:\inetpub\wwwroot\david\tes.php on line 18 PHP Warning: filemtime(): Stat failed for //pc-ci-test-02/c$/pagefile.sys (errno=2 - No such file or directory) in c:\inetpub\wwwroot\david\tes.php on line 18

              Kommentar


              • #8
                Mhh eventuell weil es Windows ist!?

                PHP-Code:
                $pagefile[0] = "\\\\\\\\pcci03\\\\c\\\\pagefile.sys";
                $pagefile[1] = "\\\\\\\\pc-ci-test-02\\\\c$\\\\pagefile.sys"
                MfG - fackelkind | codeMaster
                54 68 65 72 65 20 61 72 65 20 6F 6E 6C 79 20 31 30 20 74 79 70 65 73 20 6F 66 20 70 65 6F 70 6C 65 20 69 6E 20 74 68 65 20 77 6F 72 6C 64 3A A 54 68 6F 73 65 20 77 68 6F 20 75 6E 64 65 72 73 74 61 6E 64 20 62 69 6E 61 72 79 2C 20 61 6E 64 20 74 68 6F 73 65 20 77 68 6F 20 64 6F 6E 27 74

                Kommentar


                • #9
                  ich werde das mal ausprobieren
                  glaub aber nicht

                  Kommentar


                  • #10
                    und hör auf, zu einem thema mehrere threads aufzumachen!
                    I don't believe in rebirth. Actually, I never did in my whole lives.

                    Kommentar

                    Lädt...
                    X