Unstoppable Domains — Get your daily AI drops report

Output custom error on include() fail

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
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.
GoDaddyGoDaddy
Olitt — high-converting AI websites, only from $1/moOlitt — high-converting AI websites, only from $1/mo

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back