[Scottish] PHP configuration problem ?

Paul Millar scottish at mailman.lug.org.uk
Mon Nov 11 22:05:01 2002


Cutting the code down a bit (just to make the problem obvious) ...

On Mon, 11 Nov 2002, Tom Shearer wrote:
[...]
> 	$fp = fopen($targetfile, "a+");
>  	if (!$fp)
>       	 { echo "<strong>Your ...";
>           	  echo    "It's the ... ";}
>                	 exit;
[...]

> Any idea where I'm going wrong ?

Look where the if() clause finished, then "}" is after the echo, but 
before the exit;

So the code terminates immediately after opening the file.

Also, you might want to use "@fopen" rather than "fopen".  The "@"  
stops PHP from generating any error-HTML.

HTH

Paul.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
Particle Physics (Theory & Experimental) Groups                   Paul Millar 
Department of Physics and Astronomy                     paulm@astro.gla.ac.uk
University of Glasgow                                 paulm@physics.gla.ac.uk
Glasgow, G12 8QQ, Scotland             http://www.astro.gla.ac.uk/users/paulm 
+44 (0)141 330 4717        A54C A9FC 6A77 1664 2E4E  90E3 FFD2 704B BF0F 03E9
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --