PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi, this is really confusing me. I have config.php that is loaded with the include function into check.php. For some reason though, check.php acts as if the variables don't exist...
Depending on how your error reporting is set, it may not be finding the file to include. Where is the file located, and what is the setting for your "include path"?
Edit: stepping on Everah's post is what happens when one is a slow typist.
Hi, thanks for your replies. It actually turns out my problem is more complex. The script I showed you actually wasn't working because of another error which is fixed now. Now, my problem is this.
I currently have an index.php which includes check.php which includes config.php. When I call check.php the variables are found. When I call index.php though, I get...
Notice: Use of undefined constant BLUE in check.php
Oh ok! I isolated the problem. But I don't know how to fix it. I should of mentioned check and config are in a separate folder called includes. So it looks more like...
Pathing is why it doesn't work. That is a common mistake when it comes to including. You might want to consider creating a path_to_root variable or something along those lines so that whenever anything is included you can just say