Re: [PHP] parse error? how can I print spesific message for allerror mesage

2002-03-12 Thread Jan Rademaker

On Tue, 12 Mar 2002, Ceyhun Güler wrote:

 than the script works like mine
 but I wonder to disable Warning: Undefined index: dir in
 c:\inetpub\wwwroot\kocak\resimgoster.php on line 1
 response if someone directly enter localhost/myphp/resmigoster.php I want
 to say him that Access Denied Or something like that

use error_reporting() (see manual) to suppres warnings. to give back an
error use something like;

if (!isset($dir) || !isset($res)) {
print Access Denied;
exit;
}

 
 
 
 
 
 

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] parse error? how can I print spesific message for allerror mesage

2002-03-12 Thread Lars Torben Wilson

On Tue, 2002-03-12 at 12:32, Ceyhun Güler wrote:
 if I write directly localhost/myphp/resmigoster.php on his browser
 it response
 Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on
 line 1
 
 Warning: Undefined index: res in c:\inetpub\wwwroot\kocak\resimgoster.php on
 line 3
 
 if I write directly localhost/myphp/resmigoster.php?dir=mainres=mine
 than the script works like mine
 but I wonder to disable Warning: Undefined index: dir in
 c:\inetpub\wwwroot\kocak\resimgoster.php on line 1
 response if someone directly enter localhost/myphp/resmigoster.php I want
 to say him that Access Denied Or something like that

'The Right Way'--there are several ;)--is to initialize your 
variables. :) If you don't want to do that, then:

1) Set error_reporting(E_ALL) for development, so you catch all the   
   silly little errors we all make;
2) Set display_errors = Off in php.ini, so that users don't see any 
   errors that are generated;
3) Use set_error_handler() to create your own function which can deal
   with error messages however you like.

To the above, you can add all sorts of things. Using 
set_error_handling(), for instance, you can have error messages logged 
to a file, or sent to a socket or pipe--whatever. But turning 
error_reporting() off while developing is just going to let you get away
with all sorts of things which might come back and bite you later 
(unquoted array keys, etc).


-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php