Notice: undefined index: dec in...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • duffy832
    New Member
    • Mar 2010
    • 1

    Notice: undefined index: dec in...

    I am making changes to a php framework I downloaded and am new to PHP.

    I have this error:

    Notice: Undefined index: dec in D:\Hosting\4156 690\html\idingo \modules\groups \group_sort.php on line 49

    Line 49 looks like this:


    Code:
    		if (myNum($groupsSelect) > 0) {
    			
    			$this_counter= 0;
    			
    			for ($i = 0; $i <myNum($groupsSelect) ; $i++)	{
    
    				$groups=myF($groupsSelect);
    				$this_counter++;
    	49--->		[B]$counter_of_thumbs=$_GET['dec'];[/B]
    				$upper_limit=$counter_of_thumbs+10;
    
    				if ($this_counter>$counter_of_thumbs && $this_counter<=$upper_limit)	{
    
    					$statsSelect = myQ("SELECT `comments`,`gallery`,`users` FROM `[x]groups` WHERE `idgroups`='".$groups[4]."' ");
    					$statsArray=myF($statsSelect);
    					$galleryArray=unpk($statsArray[1]);
    					$usersArray=unpk($statsArray[2]);
    					$commentsArray=unpk($statsArray[0]);
    				
    				if (is_array($usersArray))	{
    
    					$member_num=sizeof($usersArray);
    				
    				}
    I am not sure how this works. I am assuming I haven't defined this variable but I have no idea where this definition would be done.

    Thank you for any help you may give.
    Last edited by Dormilich; Mar 10 '10, 02:14 AM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    it would be done in the URL. best practice is to test any of the Superglobals ($_GET, $_POST, $_SESSION, $_COOKIE, etc.) before accessing the value.
    Code:
    if (!isset($_GET['dec'])
    {
        // do error handling
    }

    Comment

    Working...