Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include files with die(); function?

file1.php and file2.php with die(); function.

include.php:

<? include 'file1.php';
include 'file2.php' ?>

file1.php

<? echo 'included'; die(); ?>

file2.php

<? echo 'not included'; die(); ?>

How can I include both files with die(); function?

like image 232
w35t Avatar asked Nov 24 '09 16:11

w35t


1 Answers

if (!condition){
   include_once('./inc/header.inc.php');
   echo "Errormessage";
   include_once('./inc/footer.inc.php');
   die();
}

I hope this is what you wanted.

like image 89
Timmy D'Hooghe Avatar answered Oct 17 '22 17:10

Timmy D'Hooghe