jeff5656 Posted August 11, 2010 Share Posted August 11, 2010 I did some googling and it seems you cannot include a file with an anchor: i.e include "hello.php#foo"; How do you guys go back to the middle of the page of an included file? Do you just not include files with anchors? I wanted to run my entire site inside index.php and just use includes to diplay the appropriate file, but I also need anchors to go to the middle of the page on some of those files. Quote Link to comment https://forums.phpfreaks.com/topic/210465-using-anchors-in-includes/ Share on other sites More sharing options...
Adam Posted August 11, 2010 Share Posted August 11, 2010 It doesn't work like that. Since you're including the file into index.php, the anchor passed into the original URL applies to any of the included content as well; there's no need to pass it into the files. Quote Link to comment https://forums.phpfreaks.com/topic/210465-using-anchors-in-includes/#findComment-1098178 Share on other sites More sharing options...
jeff5656 Posted August 11, 2010 Author Share Posted August 11, 2010 Thank you that is correct I was not thinking that the included file is just dumping in html/php code into the parent file. Quote Link to comment https://forums.phpfreaks.com/topic/210465-using-anchors-in-includes/#findComment-1098188 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.