From:             [EMAIL PROTECTED]
Operating system: all
PHP version:      4.1.1
PHP Bug Type:     Feature/Change Request
Bug description:  about error_reporting for $_GET

suggest that it should be possible to turn off warnning of undefined index
of $_GET ans $_POST and so on..

example:

such as:
url: http://www.domain.com/index.php
code: <?php echo $_GET['id']; ?>
would cause warnning 'Undefined index'
unless the user must type in http://www.domain.com/index.php?id=123

or.... the code should be changed into:
<?php if (!empty($_GET['id'])) print $_GET['id']; ?>
or maybe:
<?php
$id = empty($_GET['id'])?0:$_GET['id']; // just like register_global ?
.....
echo "id is: $id"; // 'no warnning' for use here
?>


of cause, we can turn off warnning for a running website.
but....how can the web developers bear it when developing ?
it's a 'terrible' warnning message that we don't want, we should have our
attentions to those warnning about variables like $foo['bar'] not
$_GET['id'] nor $_POST['username']
-- 
Edit bug report at: http://bugs.php.net/?id=14736&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to