Welcome Guest, Not a member yet? Register   Sign In
error reporting problems
#1

[eluser]taschentuch[/eluser]
hi,

how can i disable this error:

Quote:A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for User::usergroup()
Filename: admin/User.php
Line Number: 78

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\system\libraries\Exceptions.php:166)
Filename: codeigniter/Common.php
Line Number: 360

An Error Was Encountered
Missing GET data

my code:

Code:
function usergroup($user_id)
    {
    if ($user_id)
    {
    //do something
    } else {
    show_error('Missing GET data');
    }    
    }


i want only the show_error if the argument is missing and not the CI error

thx
#2

[eluser]rogierb[/eluser]
Check the isset() function @Php.net
#3

[eluser]taschentuch[/eluser]
hm yes but this error is produced before my code checks the argument...

edit:

solved

Code:
function usergroup($user_id = "FALSE")
    {
    if ($user_id != "FALSE")
    {
.
.
.
#4

[eluser]khagendra[/eluser]
Your code is
Code:
function usergroup($user_id)
    {
    if ($user_id)
    {
    //do something
    } else {
    show_error('Missing GET data');
    }    
    }

I think you are not passing argument for usergroup($user_id) function, that's y there is missing argument 1 warning.

Pass the argument it will work.
#5

[eluser]taschentuch[/eluser]
yes i want only show a error if someone forget a ID on this link ... http://host/index.php/Users/usergroup/1 but if someone goes to http://host/index.php/Users/usergroup/ got he the error

but it works now with my code ^^

thx




Theme © iAndrew 2016 - Forum software by © MyBB