noobified Posted August 30, 2008 Share Posted August 30, 2008 im wondering if someone could have a look at this and point out what is wrong, it keeps giving the following notice PHP Notice: Undefined variable: themeName0 PHP Notice: Undefined variable: blockArrowColorTheme0 PHP Notice: Undefined variable: blockBackgroundImageTheme0 case "themeImageSubmit": for ($x = 0; $x <= $totalThemes; $x++) { $themeImageValues["themeName"][$x] = ${"themeName$x"}; $themeImageValues["${"themeName$x"}"]["blockArrowColor"] = ${"blockArrowColorTheme$x"}; $themeImageValues["${"themeName$x"}"]["blockBackgroundImage"] = ${"blockBackgroundImageTheme$x"}; } themeImageSubmit($themeImageValues, $totalThemes); break; Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 30, 2008 Share Posted August 30, 2008 Shot in the dark... $x=1 Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 30, 2008 Share Posted August 30, 2008 Does this help? <?php for($i=0; $i<8; ++$i) { echo $i,"\t"; switch($i) { case 1: echo "One"; break; case 2: default: echo "Thingy"; break; case 3: case 4: echo "Three or Four"; break; case 5: echo "Five"; break; } echo "\n"; } ?> Quote Link to comment Share on other sites More sharing options...
noobified Posted August 30, 2008 Author Share Posted August 30, 2008 ? this makes no sense to me $themeImageValues["themeName"][$x] Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 30, 2008 Share Posted August 30, 2008 A case with no switch makes no sense to me. Where is your switch? Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 30, 2008 Share Posted August 30, 2008 Can you post all of your code? Quote Link to comment Share on other sites More sharing options...
noobified Posted August 30, 2008 Author Share Posted August 30, 2008 the file is fairly big so i have attached it [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 30, 2008 Share Posted August 30, 2008 I am reviewing it... Quote Link to comment Share on other sites More sharing options...
noobified Posted August 30, 2008 Author Share Posted August 30, 2008 thanks much appreciated Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 30, 2008 Share Posted August 30, 2008 I would turn notice's off in your php.ini file frankly. Basically it wants you to declare a variable before you try to use it.. so for instance.. instead of dynamically creating $themeImageValues["themeName0"]["blockArrowColor"] it wants you to do something like this: $themeImageValues["themeName0"] = array ("blockArrowColor", "blockBackgroundImage"); and THEN assign values to to them. Since this is just not practical in PHP, I would simply turn notices off, most people do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.