i have two problems with xamp
first problem
My code
if($_REQUEST['foo']){
echo 'bar';
}
error: Notice: Undefined index: foo in C:\xampp\htdocs\test_file.php on line 5
second problem
My code
define( THEME ,'theme/');
Error: Notice: Use of undefined constant THEME – assumed ‘THEME’
How i can solve this problems ?
problem solved:
i was think the problem is in xampp because files was working fine on apache but sorry that’s was my maistake , thank you all
Access to array keys that don’t exist emit a notice (except for special constructs like
issetorempty; incidentally, you could rewrite your condition asif (!empty($_REQUEST['foo'])), sinceemptyis aligned with whether a value would be converted toFALSEif coerced to a boolean), so you should check for them first.definetakes a string as a first parameter, justTHEMElooks like a constant, so PHP looks for one; not finding one it reverts to the string"THEME", which is what you want. But it’s a string you want, you should give it in the first place.