View Single Post
  #5 (permalink)  
Old 10-23-09, 07:19 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by paligron View Post
the undefined variable is the 'accessories', which is the name of the input field. How do you define it as an array? I have tried to define it normally as an array but the submitted result is always empty.
"Undefined index" means the variable you are trying to use doesn't exist (when your variable is not properly set). One way to handle this issue is to check if $_POST['action'] is set before using it. For example:

PHP Code:

if (!isset($_POST['action'])){


//If not isset -> set with dummy value
$_POST['action'] = "undefine";


__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
The Following User Says Thank You to End User For This Useful Post:
paligron (10-25-09)