Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[PHP] Verschachtelungstiefe

Empfohlene Antworten

Wenn das überhaupt das richtige Wort ist.... :-)

Also ich hab ne Frage zum Einbinden mit Include.

Ich binde in einer Datei "index.php" mit include eine Klasse "class_mail" ein.

Danach binde ich in der "index.php" eine weitere Datei "routine.php" mit Include ein.In dieser Datei "routine.php" will ich eine Instanz der Klasse "class_mail" erzeugen:

$checkemail = new class_mail();

und bekomme den Fehler:

Fatal error: Class 'class_mail' not found in XXXXX.

Wieso? Müsste die Klasse nicht auch in der include Datei "routine.php" jetzt zur Verfügung stehen? Wie kann ich die Klasse globalisieren? Damit mir diese auch noch in einer Verschachtelungstiefe von X include-Dateien zur Verfügung steht?

es reicht die in der Index.php zu includen, daher würde ich eher auf einen Codefehler in der Klasse o.ä. (groß/kleinschreibung ?) tippen.

Mach mal folgendes

Index.php:

include "class_mail.class.php"; // oder wie auch immer die Klassendatei heißt

if(!class_exists("class_mail"))

echo "FEHLER, KLASSE NICHT GEFUNDEN";

// hier weißt du dann ob in deiner klasse ein fehler ist

include "routine.php";

.... und in der routine php kannst du dann nochmal class_exists machen

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.