CLTaylor Posted February 22, 2008 Share Posted February 22, 2008 Hi - I'm a newbie and need some basic PHP help. I have created a navigation.php file with the HTML links I use this code within the HTML source code to link to it <?php include("navigation.php"); ?> but it doesn't seem to be working Can anyone see what is wrong? Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted February 22, 2008 Share Posted February 22, 2008 It'd help to see the contents of both the source file, and the included navigation.php file. Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 22, 2008 Author Share Posted February 22, 2008 Thanks for helping. I wasn't sure how much code to put here, so I'm thinking it's easier to look here: http://www.everythingmenopause.com/7dwarves.htm This is the test page I've been using and if you FIND the first php reference, it's right there. Here's the navigation file: http://www.everythingmenopause.com/navigation.php Thanks for helping Quote Link to comment Share on other sites More sharing options...
alphadeltaviii Posted February 23, 2008 Share Posted February 23, 2008 Is your main page named with the .php extension? Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 If you are referring to my index or home page by my "main page" the answer is yes. It is named index.php. Hope that helps. Quote Link to comment Share on other sites More sharing options...
Lashiec Posted February 23, 2008 Share Posted February 23, 2008 Well, I took your URL and put in index.php and it seems to be including the file correctly. The link about the 7dwarves.htm has the <?php include... ?> code in it, but because it's an .htm page it won't actually process the php code. Rename it to 7dwarves.php and it will work. PHP code is only parsed on pages with the .php extension, unless you change some settings somewhere. Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 Thanks for this answer, I will try it. But it does bring up the question, "if I rename all of my .htm files, will I lose all my backlinks etc. coming into this site?" That is a concern because this site has been up for 3 years, so does anyone know how to change "some settings" and what that means? Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted February 23, 2008 Share Posted February 23, 2008 The settings are in your httpd.conf file, look for a line such as AddHandler application/x-httpd-php php And change it to AddHandler application/x-httpd-php html htm php Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 I changed my .htaccess file to AddHandler application/x-httpd-php .html .htm .shtml .php But it doesn't appear to have worked. Not sure where the httpd.conf files lives. Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted February 23, 2008 Share Posted February 23, 2008 Is this being hosted by someone, or are you hosting this yourself? Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 This website is hosted by Godaddy Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted February 23, 2008 Share Posted February 23, 2008 Then the chances of you being able to change what extensions are loaded as PHP is very slim. You'll probably need to go change your filenames around. Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 Thanks for helping. Just FYI, does the .htaccess file serve the same purpose? Can I get this to work? Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted February 23, 2008 Share Posted February 23, 2008 The .htaccess file serves a very similar purpose, and adding handlers usually can be done through .htaccess, not sure why it isn't working in your case. Quote Link to comment Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 ok, thanks for helping Quote Link to comment 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.