phppup Posted March 21, 2012 Share Posted March 21, 2012 I am having trouble using INCLUDE in my HTML. I know I've used it before, so I don't understand where my problem is coming from. I created a simple HTML file named ok.htm, it has ONE line that says HI. For testing, I actually added a second line for it to INCLUDE ITSELF: <!--#include virtual="ok.htm" --> It didn't work in itself, or any other HTML pages. What am I doing wrong on my local machine? Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/ Share on other sites More sharing options...
Proletarian Posted March 21, 2012 Share Posted March 21, 2012 Is your localhost server set up for server side includes? Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/#findComment-1329875 Share on other sites More sharing options...
phppup Posted March 21, 2012 Author Share Posted March 21, 2012 Not sure. SO you're saying this ONLY works on the server that I maintain the website on? And the machine in my bedroom probably won't recognize it? Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/#findComment-1329891 Share on other sites More sharing options...
phppup Posted March 21, 2012 Author Share Posted March 21, 2012 OK, so I tried to get the html to INCLUDE on my server, and it didn't work either. Now what? Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/#findComment-1329909 Share on other sites More sharing options...
Drummin Posted March 21, 2012 Share Posted March 21, 2012 Will this display on your page. <?php echo "Hello, I have php enabled on my site."; ?> Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/#findComment-1330030 Share on other sites More sharing options...
Proletarian Posted March 22, 2012 Share Posted March 22, 2012 Not sure. SO you're saying this ONLY works on the server that I maintain the website on? And the machine in my bedroom probably won't recognize it? Whichever server you are using, remove or local, is that server set up for server-side includes? I ask this question because the method you are using is a server-side include method and in order for it to work relies on the server being set up for it. Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/#findComment-1330222 Share on other sites More sharing options...
phppup Posted March 23, 2012 Author Share Posted March 23, 2012 Hey Drummin. Nope, it won't work. I've concluded that the server will NOT run PHP in an HTML file. (i believe this is one of the reasons I got roped into learning full blown PHP in the first place... LOL) It appears INCLUDES are also suspect. Although I've seen some articles that blame IntExplorer too. I suppose I'll survive with just PHP files (but I'd have liked to see them as HTML at home, where my PC isn't running PHP.) Quote Link to comment https://forums.phpfreaks.com/topic/259424-include-wont-work/#findComment-1330556 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.