look at my index.php , its in root folder. <?php include("inc/header.php"); ?> Code (markup): in my header.php , its in "inc" folder <?php include("/inc/menu_top.php"); ?> Code (markup): menu_top.php is located in "inc" folder . but when i open index.php , it gives this error could someone tell me whats wrong with it??
ok i made it : <?php include("inc/menu_top.php"); ?> but it is still not working.. still giving same error..
ooooooppppppssssss ...... so sorry nico_swd.. your code worked.. i just had to rename the file to menu_top.php , actually i renamed it to nav_top.php earlier to test other files.. and i forgot to rename it back to menu_top.php. thanks nico_swd u are right i just needed to remove the slash from code.. I really appreciate that u help me.. i want to give +rep but it is saying " please spread some reputation around before giving it to nico_swd again." so.. the only thing i can give u is thanks.
Sometimes your invalid include path in the php.ini can be a cause to the error you have mentioned. If so, then first identify your Loaded Configuration File and change include_path = ".;C:\xampp\php\PEAR;" to include_path = ".;C:\xampp\php\PEAR;C:\applicationFolder;C:\applicationFolder\conf" And restart your apache and refresh the page.
Warning:include(./includes/footer.inc.php) [function.include] : failed to open the stream : No such file or directory in C:xampp\htdocs\phpsols\contact.php on line 270 Pls I need solution to this bug
The question is, do you understand WHY James' solution worked? From the viewpoint of a file in inc, a file in inc isn't in inc, it's in the current directory. inc/header.php would only work if you had /home/bilalgho/public_html/inc/inc/header.php
Go to your site. You can use CPanel's file functions or you can use an FTP program. Look in /home/bilalgho/public_html/inc (You may only be able to get to public_html, not to /home/bilalgho/public_html. That's okay. Just go to inc from there. Is there a file in there named header.php? menu_top.php says there is. If it's not there, you have a missing (or misplaced) file.
You're just going to have to find out where header.php actually is, then change the code to point to that location. No one can tell you where it is without access to your site. (It's also possible, but not very likely, that the file has no permissions, so it can't be read, or it's defective.)
And we have no idea where the file is located (or if it even exists), so any path any of us posts may or may not work.