[FX.php List] PHP question

Dale Bengston dbengston at tds.net
Thu Jul 17 12:37:30 MDT 2008


Oops, that's backwards. Remove the exclamation point. Clipped some  
code and didn't read it all the way!

if (file_exists('blah.php))
	{
	include_once('blah.php');
	}
else
	{
	include_once('error.php');

Dale

On Jul 17, 2008, at 1:29 PM, Dale Bengston wrote:

> Hi Bob,
>
> PHP has all sorts of groovy ways to trap such things.
>
> if (!file_exists('blah.php))
> 	{
> 	include_once('blah.php');
> 	}
> else
> 	{
> 	include_once('error.php');
>
> ... with the usual caveats about getting upper/lower case, paths,  
> etc. all figured out.
>
> Hope this helps,
> Dale
>
> On Jul 17, 2008, at 12:52 PM, bob at patin.com wrote:
>
>> I have a site where I'm including these static HTML pages;  
>> sometimes my
>> client doesn't put the pages where he's supposed to, and so the  
>> page shows
>> an error.
>>
>> If I have code like this:
>>
>> include_once($mypage);
>>
>> and the referenced page doesn't exist, is there a way to trap that  
>> and
>> send the user to an error page instead?
>>
>> Thanks,
>>
>> Bob Patin
>> Longterm Solutions
>> bob at longtermsolutions.com
>> 615-333-6858
>> http://www.longtermsolutions.com
>> iChat: bobpatin
>> AIM: longterm1954
>> FileMaker 9 Certified Developer
>> Member of FileMaker Business Alliance and FileMaker TechNet
>> --------------------------
>> FileMaker hosting and consulting for all versions of FileMaker
>> PHP • Full email services • Free DNS hosting • Colocation •  
>> Consulting
>>
>>
>>
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list