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? Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/ 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. Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-473803 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 Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-473879 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? Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474127 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. Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474157 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. Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474259 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? Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474591 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 Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474592 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. Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474610 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? Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474614 Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 This website is hosted by Godaddy Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474626 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. Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474627 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? Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474628 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. Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474630 Share on other sites More sharing options...
CLTaylor Posted February 23, 2008 Author Share Posted February 23, 2008 ok, thanks for helping Link to comment https://forums.phpfreaks.com/topic/92482-php-navigation-file/#findComment-474632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.