Ankündigung

Einklappen
Keine Ankündigung bisher.

Fatal error: Class 'HTML' not found in C:\xampp\htdocs\SMC\common.php on line 18

Einklappen

Neue Werbung 2019

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

  • Fatal error: Class 'HTML' not found in C:\xampp\htdocs\SMC\common.php on line 18

    ich bekomme die folgende Fehlermeldung:
    public function printHead() { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "" } public funtion printBody($css = null) { echo "\n"; echo "\n"; } } public function printFoot() { echo ""; } }
    Fatal error: Class 'HTML' not found in C:\xampp\htdocs\SMC\common.php on line 18

    Skript:
    main.php

    PHP-Code:
    <?php 
    //Einbinden von common
    require_once "common.php";
    //Einbinden von Checkuser
    include ("checkuser.php"); 
    //head
    $HTML->printHead();
    //body
    $HTML->printBody();
    //seitenaufbau
    echo "<div id='header'>";
    include 
    'header.php';
    echo 
    "</div>";
    echo 
    "<div id='main'>";
    echo 
    "<iframe src='welcome.php' style='border:0px #FFFFFF none;' name='iframe' scrolling='auto' frameborder='0' marginheight='0px' marginwidth='0px' height='100%' width='100%'></iframe>";
    echo 
    "</div>";
    //foot
    $HTML->printFoot();
    ?>
    common.php
    PHP-Code:
    <?php
    //Definition des Projektnamens
    define('PROJECT'"/SMC");
    //Für Links auf das File Verzeichnis
    define('DOCUMENT_ROOT'$_SERVER['DOCUMENT_ROOT'].PROJECT);
    //für Webadressierung
    define('HTTP_ROOT'"http://".$_SERVER['HTTP_HOST'].PROJECT);

    //Datenbanksettings und weitere systemweite Einstellungen
    require_once DOCUMENT_ROOT."/settings.php";
    //Alle Klassen und prozedurale Skripte einbinden
    require_once DOCUMENT_ROOT."/inc/includeAllClasses.php";
    //Fehlermeldungen
    error_reporting(E_ALL);


    //global verfügbares HTML-Objekt erstellen
    $HTML = new HTML();

    //global verfügbares Datenbankobjekt erstellen
    $DB = new DB();

    //global verfügbares Sicherheitsobjekt erstellen
    $SECURITY = new Security();
    ?>
    includeAllClasses.php
    PHP-Code:
    <?php
    //Datenbankklasse
    require_once DOCUMENT_ROOT."/inc/classes/DB/class.DBMySQL.php";
    //HTML-Klasse
    require_once DOCUMENT_ROOT."/inc/classes/HTML/class.HTML.php";
    //Sicherheitsklasse
    require_once DOCUMENT_ROOT."/inc/classes/Security/class.Security.php";
    ?>
    class.HTML.php
    PHP-Code:
    public function printHead()
    {
    echo 
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\">\n";
    echo 
    "<html><head>\n";
    echo 
    "<title>".HTML_TITLE."</title>\n";
    echo 
    "<link rel='stylesheet' type='text/css' "."href='".HTTP_ROOT."/inc/css/default.css.php>\n";
    echo 
    "<script src='".HTTP_ROOT."/inc/js/default.js' "."type='text/javascript'></script>\n";
    echo 
    "<link rel='SHORTCUT ICON' href='".HTTP_ROOT."/inc/fav/favicon.ico' type='image/x-icon'>"
    }

    public 
    funtion printBody($css null)
    {
    echo 
    "</head>\n";
    echo 
    "<body";

    if(
    $css!=null)
    {
    echo 
    " style='".$css."'";
        }
            echo 
    ">\n";
        }
    }

    public function 
    printFoot()
    {
    echo 
    "</body></html>";

    Die Pfade habe ich schon überprüft.
    findet jemand die Ursache?
    Ich hoffe ihr könnt mir helfen.
    Schon mal danke für die Hilfe

  • #2
    Hi,

    fehlt dir einfach die Klassendeklaration in der class.HTML.php ? Oder hast du die nur nicht mitkopiert?

    Kommentar


    • #3
      Zitat von cycap Beitrag anzeigen
      Hi,

      fehlt dir einfach die Klassendeklaration in der class.HTML.php ? Oder hast du die nur nicht mitkopiert?
      PHP-Code:
      class HTML {
      public function 
      printHead()
      {
      echo 
      "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\">\n";
      echo 
      "<html><head>\n";
      echo 
      "<title>".HTML_TITLE."</title>\n";
      echo 
      "<link rel='stylesheet' type='text/css' "."href='".HTTP_ROOT."/inc/css/default.css.php>\n";
      echo 
      "<script src='".HTTP_ROOT."/inc/js/default.js' "."type='text/javascript'></script>\n";
      echo 
      "<link rel='SHORTCUT ICON' href='".HTTP_ROOT."/inc/fav/favicon.ico' type='image/x-icon'>"
      }

      public 
      funtion printBody($css null)
      {
      echo 
      "</head>\n";
      echo 
      "<body";

      if(
      $css!=null)
      {
      echo 
      " style='".$css."'";
          }
              echo 
      ">\n";
          }
      }

      public function 
      printFoot()
      {
      echo 
      "</body></html>";
      }

      ist das so richtig?

      da ändert sich die Fehlermeldung etwas:

      class HTML{ public function printHead() { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "" } public funtion printBody($css = null) { echo "\n"; echo "\n"; } } public function printFoot() { echo ""; } }
      Fatal error: Class 'HTML' not found in C:\xampp\htdocs\SMC\common.php on line 18

      Kommentar


      • #4
        rofl da hab ich doch glatt übersehen das du keine <? Tags verwendest

        Kommentar


        • #5
          Zitat von cycap Beitrag anzeigen
          rofl da hab ich doch glatt übersehen das du keine <? Tags verwendest
          Vielen Dank der Fehler ist weg und jetzt funzt alles!

          Kommentar

          Lädt...
          X