RE: [PHP] HTML if no PHP

2003-02-04 Thread John W. Holmes
> 3) Include and execute capturing critical errors: > > $hf = fopen($incfile, 'r'); > if ($hf) { > $buffer = fread($hf, filesize($incfile)); > fclose($hf); > } > if ($buffer) { > global $php_errormsg; > $php_errormsg = null; > @eval($buffer); > $err = $php_errormsg; > } >

Re: [PHP] HTML if no PHP

2003-02-04 Thread Ernest E Vogelsinger
ly handle any critical error that would bring your script to an immediate halt in case of @include. HTH :) - Original Message - From: "Bob Lockie" <[EMAIL PROTECTED]> To: "php-general Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, February 04, 2003 6:11 PM Subje

Re: [PHP] HTML if no PHP

2003-02-04 Thread Philip Olson
> I want to display an HTML page if PHP can't load an include > file or otherwise has an error or just doesn't work. > How do I do this? include returns false on failure and here's a hack to demonstrate. Once you implement your own error handling, be sure to set error_reporting accordingly or

Re: [PHP] HTML if no PHP

2003-02-04 Thread John Nichel
if ( !@include ( "myfile.php" ) ) { // do this if file cannot be included ...code... ...code... } Bob Lockie wrote: I want to display an HTML page if PHP can't load an include file or otherwise has an error or just doesn't work. How do I do this? -- PHP General Mailing List (h

Re: [PHP] HTML if no PHP

2003-02-04 Thread V Dub
Quoting Bob Lockie <[EMAIL PROTECTED]>: ### ### I want to display an HTML page if PHP can't load an include file or ### otherwise has an error or just doesn't work. ### How do I do this? ### if (!$variable){print('your html stuff');} Kinda basic, but it might help. Cheers! VW ### ### --

RE: [PHP] HTML if no PHP

2003-02-04 Thread Jon Haworth
Hi Bob, > I want to display an HTML page if PHP can't load an > include file or otherwise has an error or just doesn't work. > How do I do this? Not sure you can, especially not for the "just doesn't work" scenario. FWIW, you can test for the existence of a file before including it: if (file_e

[PHP] HTML if no PHP

2003-02-04 Thread Bob Lockie
I want to display an HTML page if PHP can't load an include file or otherwise has an error or just doesn't work. How do I do this? -- Sent from Mozilla and GNU/Linux. Powered by an AMD processor. -- PHP General Mailing List (http://www.php.net/) To uns