Hello,
I am working a project and this has different categories e.g. Development, Design, Hosting etc. I am using a main index.php on root and all the categories on the same folder where I have this main index.php. When a user clicks on any category, it calls index.php of that category. For example, if user clicks on a link/category hosting, it calls the index.php of that category. Its working fine for all other categories except one. Can anybody please give any idea why this is happening because these are on same level and I dont find any unusual thing in it.
TIA!
File does not get included
Moderator: General Moderators
Thanks Volka!
I am using 'switch' for it. If query string has 'domain', display file of it, if query string has 'hosting', display file of it and so on. If no matches then display the default. After playing a bit with it, I just have come to know that switch does not display not only if there is no match but also if the matching file has some errors or warnings. Does it make any sense?
Please advise!
Thanks once again.
I am using 'switch' for it. If query string has 'domain', display file of it, if query string has 'hosting', display file of it and so on. If no matches then display the default. After playing a bit with it, I just have come to know that switch does not display not only if there is no match but also if the matching file has some errors or warnings. Does it make any sense?
Please advise!
Thanks once again.
Honestly? No.amir wrote:I just have come to know that switch does not display not only if there is no match but also if the matching file has some errors or warnings. Does it make any sense?
I guess you forgot to use break at the end of each case block and the other files have a die/exit statement somewhere in them.
Code: Select all
switch($yadda) {
case 'abc':
require 'abc/index.php';
break;
case 'xyz':
require 'shalalalalu/index.php';
break;
default:
require 'error.php';
break;
}