PHP-Einfach.de
  • PHP Tutorial
  • MySQL Tutorial
  • Für Fortgeschrittene
  • Webhosting
  • Jobs
  • Forum

Codeschnipsel

Include-Sperre

Zurück zur Übersicht
Falls ihr wollt, dass eine eurer Dateien entweder nur includet werden, oder nicht von allen Scripten includet werden darf, helfen euch folgende Schnipsel:

Hier der Einzeiler für das nur includen:

if ($_SERVER['SCRIPT_FILENAME'] == __FILE__) die("Sie dürfen diese Datei nur includen!");


Nur bestimmte Scripte dürfen includen:

$scripts=array("/", "/index.php"); # Hier die Scripte einfügen
if ($_SERVER['SCRIPT_FILENAME'] != __FILE__ && !in_array($_SERVER['REQUEST_URI'], $scripts)) die("Die Datei ".substr($_SERVER['REQUEST_URI'], 1)." ist nicht zum includen befugt.");


Kommentare

Autor CodeFetch

Zurück zur Übersicht
Autor: Nils Reimers
Zurück: URLs im Text identifizieren

Für Fortgeschrittene

  • Objektorientierte Programmierung
  • PHP Sicherheit
  • Script-Beispiele
  • Codeschnipsel
  • Stellenmarkt
Mit freundlicher Unterstützung von:
  • Punkt191 Werbeagentur
  • Casinopilot24.com
  • Casino utan Spelpaus
  • Casino utan Spelpaus med Trustly
  • Neueonline-Casinos.com
  • CasinoHEX.at
  • Decasinos.de
  • Privatkredit247.com
  • CasinoAdvisers.com
  • parhaatuudetkasinot.com
  • Online Casino Spielautomaten

Hoster – Geringste Ausfallzeit

  1. webgo Ø 1 Min.
  2. netcup Ø 5 Min.
  3. Linevast Ø 7 Min.
  4. Mittwald Ø 13 Min.
  5. manitu Ø 14 Min.
  6. dogado Ø 14 Min.
  7. All-Inkl.com Ø 20 Min.
  8. Host Europe Ø 21 Min.
  9. bplaced Ø 22 Min.
  10. Strato Ø 26 Min.
» Mehr erfahren

Impressum | Datenschutz | Auf PHP-Einfach.de werben

© PHP-Einfach.de 2003 - 2021

Um dich beim Lernen von PHP und MySQL zu unterstützen verwenden wir Cookies. OK Weitere Infos
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Notwendige
immer aktiv

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Nicht notwendige

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.