Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

wordpress - Undefined index errors (PHP) -


i'm getting notices of undefined index "id" on lines 3, 6 , 7 in code. can't figure out i'm doing wrong:

    if ( isset($_post['action']) && $_post['action'] == 'save' ) {     foreach ($options $value) {         if(($value['type'] === "checkbox" or $value['type'] === "multiselect" ) , is_array($_request[ $value['id'] ]))             { $_request[ $value['id'] ]=implode(',',$_request[ $value['id'] ]); //this take array , make 1 string             }         $key = $value['id'];           $val = $_request[$key];         $settings[$key] = $val;     } 

i'm thinking small thing fix haven't had luck i've tried. 1 thing did run var_dump($key) , $key null , it's not. i'm assuming has this.

this part of options page wordpress theme, way. code runs part of "save" function.

the script works if debug mode turned off, when debug mode on, these notices pop when hitting save button on options page. in advance insights, , let me know if need post more code give more context.

edit: i've posted options page in pastebin. it's long. contains t13lo's fixes. problem code on line 1957. thanks: http://pastebin.com/ngx6qzgr

you can change line 3 to:

if ( ($value['type'] === "checkbox" || $value['type'] === "multiselect" ) && isset($_request['id']) && is_array($_request[ $value['id'] ]) ) 

however, rest of code in foreach seems dependent upon $value['id']. value not being set may make these lines:

$key = $value['id'];   $val = $_request[$key]; $settings[$key] = $val; 

irrelevant if $value['id'] not set. if that's case, placing of code in foreach within if (isset($value['id'])) { may appropriate.

you'll need further analyze , understand code (and needs be) doing in order determine correct logic.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -