Jump to content

Recommended Posts

Posted

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)

Posted

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.

Posted

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.

Posted (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 by Wickham
Posted
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.
Posted

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.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...