prabir Posted October 7, 2010 Share Posted October 7, 2010 Hello Everyone, i am fairly new in PHP coding, and facing some issue with include function in php. my problem is as follows: in a php script which is located at "/include/cart.php" i am including a html page "cart_add.html" which is at location "/cart_add.html" now whenever i am clicking on any links on this page "cart_add.html" browser looking for all other pages at location "/include/" instead of "/" so in the browser i see url as "http://localhost/include/index.html" instead of "http://localhost/index.html" so i get error like this : [an error occurred while processing this directive] The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please help me to resolve this issue. Thanks very much Link to comment https://forums.phpfreaks.com/topic/215309-include-path-issue/ Share on other sites More sharing options...
prabir Posted October 7, 2010 Author Share Posted October 7, 2010 Hello guys, sorry to bother all of you with this silly question, i figure it out its not a php issue , its just my mistake, i need to give absolute path for all the link instead of relative path. Link to comment https://forums.phpfreaks.com/topic/215309-include-path-issue/#findComment-1119664 Share on other sites More sharing options...
rwwd Posted October 7, 2010 Share Posted October 7, 2010 Yep, best to set up a constant that holds the base path information so that you can just pop that in, instead of typing it out all of the time. At least you figured that out! Rw Link to comment https://forums.phpfreaks.com/topic/215309-include-path-issue/#findComment-1119666 Share on other sites More sharing options...
prabir Posted October 7, 2010 Author Share Posted October 7, 2010 Hey thanks for the suggestion i will do that Link to comment https://forums.phpfreaks.com/topic/215309-include-path-issue/#findComment-1119670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.