catweasel Posted February 8, 2009 Report Share Posted February 8, 2009 Hi, I am using a Content Management System that generates .shtml pages. I would like to display an RSS Newsfeed on a page that requires me to insert a php include like the following : require_once "/path/to/carp.php"; CarpCacheShow("http://domain_name.com/path/to/rss/feed/file"); ?> However, the generated .shtml page displays this error message : [an error occurred while processing this directive] I would like to know whether I can display a 'php include' within a .shtml file. I have read on message boards/Google that the error may be down to my Server configuration. I have tried options such as adding : AddType application/x-httpd-php .shtml to my .htaccess file, but this does not work (adding this just downloads my index.shtml file to my desktop!). Any help/ideas much appreciated. Thanks, Ray Server: Unix; Ubuntu Linux (php 4 and 5) Quote Link to comment Share on other sites More sharing options...
Andrea Posted February 8, 2009 Report Share Posted February 8, 2009 Try: AddHandler x-httpd-php .shtml If that doesn't work, check your hosts help files - I discovered when I worked on the above that hosts may have different requirements for their htaccess files - the above works on Godaddy. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 8, 2009 Report Share Posted February 8, 2009 Just to clarify, since Thelma didn't say specifically, add that line to your .htaccess file in your site root. Quote Link to comment Share on other sites More sharing options...
catweasel Posted February 8, 2009 Author Report Share Posted February 8, 2009 Hi, Thanks for your replies. AddHandler x-httpd-php .shtml I tried adding the above to the .htaccess file, but this still gave the same error message. I have put another Support question into my Hosting company, asking if there any specific requirements for the .htaccess file. (Unfortunately I never get the same Support person, so we end up going around in circles :mad:) Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 12, 2009 Report Share Posted February 12, 2009 (edited) If you succeed in changing .shtml to .php so that the page is processed as PHP, will the SHTML work? Some codes are different in SHTML. Unless AddHandler means that it processes both, which I think is unlikely. Does your hosting service support PHP? Why not use a SHTML "include" for a complete .php file set up with PHP? The included PHP file with doctype, html tag, head section and body should be processed as PHP first, then included by the SHTML "include". This would not involve any edits to .htaccess. Edited February 12, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
Andrea Posted February 12, 2009 Report Share Posted February 12, 2009 If you succeed in changing .shtml to .php so that the page is processed as PHP, will the SHTML work?Good point - hadn't thought of that - but I don't know one way or the other. Quote Link to comment Share on other sites More sharing options...
shelfimage Posted February 12, 2009 Report Share Posted February 12, 2009 If you are using godaddy, you might need to use this in your .htaccess file instead of AddHandler x-httpd-php .shtml AddHandler php .shtml If you succeed in changing .shtml to .php so that the page is processed as PHP, will the SHTML work? Maybe you can save your code in a separate file, like rss-feed.php, and then include using .shtml includes. 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.
Note: Your post will require moderator approval before it will be visible.