Please help me again! I have problems with this code:
<?php
$pathThemes = INC_DIR . "themes";
$d = dir($pathThemes);
while (false !== ($entry = $d->read())) {
$fileInfo = pathinfo($pathThemes . '/' . $entry);
if ('php' == $fileInfo['extension']) {
include_once($pathThemes . '/' . $entry);
$name = $fileInfo['filename'];
if (!$GLOBALS['fc_config']['themes'][$name]['name']) {
unset($GLOBALS['fc_config']['themes'][$name]);
}
}
}
?>
It says me:
Notice: Undefined index: name in C:\wamp\www\FlashChat_v607\chat\inc\include_themes.php on line 10
Notice: Undefined index: name in C:\wamp\www\FlashChat_v607\chat\inc\include_themes.php on line 10
Notice: Undefined index: name in C:\wamp\www\FlashChat_v607\chat\inc\include_themes.php on line 10
Notice: Undefined index: name in C:\wamp\www\FlashChat_v607\chat\inc\include_themes.php on line 10
Tyler McHenry
77k18 gold badges126 silver badges171 bronze badges
-
3FYI, since it seems that you got an answer that you liked to your previous question, you should go back and "accept" it by clicking the checkmark next to the answer that worked.Tyler McHenry– Tyler McHenry2010年05月18日 20:19:49 +00:00Commented May 18, 2010 at 20:19
3 Answers 3
try using isset( $GLOBALS['fc_config']['themes'][$name]['name'] ) with the not
answered May 18, 2010 at 20:20
-
@Marin: isset works differently for you than everyone else? Prove it. Post the new code.webbiedave– webbiedave2010年05月18日 20:29:44 +00:00Commented May 18, 2010 at 20:29
-
<?php $pathThemes = INC_DIR . "themes"; $d = dir($pathThemes); while (false !== ($entry = $d->read())) { $fileInfo = pathinfo($pathThemes . '/' . $entry); if ('php' == $fileInfo['extension']) { include_once($pathThemes . '/' . $entry); $name = $fileInfo['filename']; if (!$GLOBALS ['fc_config']['themes'][$name]['name']) { !isset( $GLOBALS['fc_config']['themes'][$name]['name'] ) } } } ?>Marin– Marin2010年05月18日 20:34:34 +00:00Commented May 18, 2010 at 20:34
-
Marin: First of all, calm down. Second, put the code you tried into the original question so that it can be formatted correctly. Third, don't demand "full corrected code". If something didn't work, then we simply need to explore the problem in greater depth. People here aren't trying to trick you, but neither are they here to do your bidding; they're spending their own time to help you out of courtesy. Be polite, learn how to use this site, and don't treat it as a substitute for expending some effort to solve your own problems or for learning on your own.Tyler McHenry– Tyler McHenry2010年05月18日 20:43:48 +00:00Commented May 18, 2010 at 20:43
-
I'm so sorry if I sounded rude,I didn't mean that:( Sorry to all,but I am anxious cause I have to deliver the project on Monday and I don't have enough time to finish it! I will post below the first code,that generates me an error.Thnx 4 helping me:)Marin– Marin2010年05月18日 20:46:10 +00:00Commented May 18, 2010 at 20:46
-
1Marin: It's nearly impossible to read code that is posted in comments. Go back and edit your original question at the top of the page to include the new code that you tried and didn't work, so that it can be formatted properly and people can take a look at it.Tyler McHenry– Tyler McHenry2010年05月18日 20:49:47 +00:00Commented May 18, 2010 at 20:49
Try this:
if (!empty($name) && isset($GLOBALS['fc_config']['themes'][$name]['name'])) {
unset($GLOBALS['fc_config']['themes'][$name]);
}
answered May 18, 2010 at 20:22
lang-php