Author |
Message |
Brownside
Guest
|
Posted: Wed Mar 16, 2005 8:09 am |

|
I need to place some simple php scripts and server side includes into my rss-template, but they do not seem to work. They work fine on all my other web pages until I tried to use them in my rss-template. The rss2html script and its generated rss pages work great, but I just can't figure out how make my SSI and other php scripts function within the rss-template.
Does anyone here know why my SSI might not be working within my rss-template, but work fine everywhere else? I have schmod the directory/files to 777 just to test, and I even placed the rss2html directory/files outside my cgi-bin. I updated everything accordingly and it worked fine, but again any SSI or php scripts still did not work within my rss-template. It makes no sense to me as to why it works on all my other web pages, except on any rss2html generated pages. I'm baffled! I have tried many different things and now I'm out of ideas, any help will be greatly appreciated.
Does the rss2html script even allow or recognize SSI, and simple php scripts that need to be placed with the template file? If not, when can this be added to the rss2html script?
|
|
|
|
 |
Tech Support
Joined: 27 Aug 2004
Posts: 693
|
Posted: Wed Mar 16, 2005 1:09 pm |

|
Another approach would be to create the webpage as a normal webpage, and then use server side inclusions within that webpage to call the rss2html.php script, to insert a table (or similar structure), with the feed inside it. That way all your SSI and other stuff will work fine.
|
_________________
FeedForAll Support
Last edited by Tech Support on Wed Mar 16, 2005 2:52 pm; edited 1 time in total
|
|

|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 314
|
Posted: Wed Mar 16, 2005 2:14 pm |

|
Brownside wrote: |
I need to place some simple php scripts and server side includes into my rss-template, but they do not seem to work. They work fine on all my other web pages until I tried to use them in my rss-template. The rss2html script and its generated rss pages work great, but I just can't figure out how make my SSI and other php scripts function within the rss-template.
[snip]
Does the rss2html script even allow or recognize SSI, and simple php scripts that need to be placed with the template file? If not, when can this be added to the rss2html script? |
Yes this is all able to be done. But you have to configure your server to process server-side include and PHP in the same file type. Normally PHP is only processed in .php files. Server-side includes are only processed in .shtml files.
If you add the following line to your .htaccess file, it will tell apache to process PHP in .shtml files along with SSI.
AddType application/x-httpd-php php html shtml
It will actuall allow PHP in normal .html files too.
Jim
|
|
|
 
|
 |
Brownside
Guest
|
Posted: Mon Mar 21, 2005 1:59 am |

|
Thanks Guys!
All of my web pages are in php and not html and all of my SSI work great, except with 'rss2html' feed pages.
Here an example of how my php SSI work:
MacSupport I will put that into my .htaccess file and test it. I hope it works! :)
|
|
|
|
 |
Brownside
Guest
|
Posted: Mon Mar 21, 2005 2:22 am |

|
By the way my 'rss2html' template is also a php file and it works fine except for any SSI php scripts within it do not work.
|
|
|
|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 314
|
Posted: Mon Mar 21, 2005 10:59 am |

|
Brownside wrote: |
By the way my 'rss2html' template is also a php file and it works fine except for any SSI php scripts within it do not work. |
By default apache webservers only process PHP in .php, .php3 files. If server side includes are enabled they are processed only in .shtml files. You need to tell the server to process PHP and SSI in the file type you are using. The simplest way is to enable PHP in .shtml files. Add the following to your server's httpd.conf if you can, or to the .htaccess in the directory.
AddType application/x-httpd-php php php3 html shtml
That will enable PHP to be in .php, .php3, .html and .shtml files
Jim
|
|
|
 
|
 |
Brownside
Guest
|
Posted: Tue Mar 22, 2005 5:22 am |

|
|
|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 314
|
Posted: Tue Mar 22, 2005 10:50 am |

|
Is that being written to the page by your template?
|
|
|
 
|
 |
Brownside
Guest
|
Posted: Tue Mar 22, 2005 1:26 pm |

|
No but the following is.
I'm using all of the SSI below and they get written on the following url:
http://www.incomelink.net/web/plates/theplate.php
That url will be the main template for my entire site, as I'm about to update my whole site with SSI for everything on my webpages except for any main text.
|
|
|
|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 314
|
Posted: Tue Mar 22, 2005 1:36 pm |

|
Brownside wrote: |
No but the following is.
I'm using all of the SSI below and they get written on the following url:
http://www.incomelink.net/web/plates/theplate.php
That url will be the main template for my entire site, as I'm about to update my whole site with SSI for everything on my webpages except for any main text.
|
The reason I as is with it showing up in there as ... ?> implies it is being written out from with in running PHP code. If that is true then it can't be processed. Which would mean if you have any PHP code in your template file it will not be executed.
Could you post a link or a copy of your template so I can help debug this further.
Jim
|
|
|
 
|
 |
Brownside
Guest
|
Posted: Tue Mar 22, 2005 2:26 pm |

|
|
|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 314
|
Posted: Tue Mar 22, 2005 2:41 pm |

|
Okay, first you are not using Server Side Includes. Those are done with , you are just doing includes in PHP which are very different beasts.
Second, what you are trying to do is not supported by simple PHP. When rss2html.php reads you template file it just writes out the data and does some simple subistutions. So of course any PHP in that file will not be processed by the PHP engine. It can be done with more complex PHP using eval() and ob_start() and friends.
Your best bet is restructure your page to not have the PHP in the template file and possilbe use a fopen() to rss2html.php to get the contents of that and then write that to your page.
Jim
|
|
|
 
|
 |
Brownside
Guest
|
Posted: Tue Mar 22, 2005 2:58 pm |

|
I do not know anything about that? How do I use that form of include? Or in other words if I want the stuff inside my 'includea' file to show up on all my webpages, do I do the following:
|
|
|
|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 314
|
Posted: Tue Mar 22, 2005 3:46 pm |

|
Brownside wrote: |
I do not know anything about that? How do I use that form of include? Or in other words if I want the stuff inside my 'includea' file to show up on all my webpages, do I do the following:
|
Nope, that is the syntax for Apache to do an SSI
More information is available at www.apache.org
|
|
|
 
|
 |
Brownside
Guest
|
Posted: Tue Mar 22, 2005 11:17 pm |

|
Okay, well thank you for your time. I will do some major research on all of this and hopefully I will figure it out.
|
|
|
|
 |
|