Dynadot โ€” .com Transfer

Output custom error on include() fail

SpaceshipSpaceship
Watch

Barrucadu

Established Member
Impact
64
I've been wondering how to do this for quite a while, and when I figured it out, it seemed so obvious! I'll post is here in case it helps anyone:

PHP:
<?php

$file = 'page.php';

if(!@include($file)){
	die('<strong>Error</strong><br/>Required file "'.$file.'" could not be included.');
}

?>
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back