Page 1 of 1

Including a file inside die

Posted: Sat Apr 12, 2003 6:28 pm
by nigma
Hey I would like to include a file inside a die() function.

Like inside this code:

Code: Select all

if (checkLogin() == FALSE) 
{ 

die (
'
<html>
<head>
<title>&#1111; M C 0 ] Login Failed</title>
<link rel="stylesheet" type="text/css" href="layout.css" />
<script language="JavaScript" src="pop_up.js"></script>
</head>

<body>

<div id="Header"><h2></h2></div>

<div id="Content">

Login Failed

</div>

// Would like to include the file here.

</body>

</html>');

Anyone know how to do this?
&#125; 
?>

Posted: Sun Apr 13, 2003 12:04 pm
by twigletmac
Why not try something like:

Code: Select all

<?php
if (!checkLogin()) {
?>
<html> 
<head> 
<title>[ M C 0 ] Login Failed</title> 
<link rel="stylesheet" type="text/css" href="layout.css" /> 
<script language="JavaScript" src="pop_up.js"></script> 
</head> 

<body> 

<div id="Header"><h2></h2></div> 

<div id="Content"> 

Login Failed 

</div>
<?php 
    include 'file.php';
?>
</body> 

</html>
<?php
    exit();
}
?>
instead of having all of that in a die() statement.

Mac