FeedForAll Forum Index ?
?Home?????FAQ????? Search ?????Memberlist ?????Register ?????Profile? ????Log in
?PHP scripts/SSI problems! View next topic
View previous topic
Post new topicReply to topic
Author Message
Brownside
Guest





PostPosted: Wed Mar 16, 2005 8:09 am Reply with quoteBack to top

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

PostPosted: Wed Mar 16, 2005 1:09 pm Reply with quoteBack to top

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
View user's profileSend private message
MacSupport



Joined: 24 Feb 2005
Posts: 314

PostPosted: Wed Mar 16, 2005 2:14 pm Reply with quoteBack to top

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
View user's profileSend private messageVisit poster's website
Brownside
Guest





PostPosted: Mon Mar 21, 2005 1:59 am Reply with quoteBack to top

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





PostPosted: Mon Mar 21, 2005 2:22 am Reply with quoteBack to top

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

PostPosted: Mon Mar 21, 2005 10:59 am Reply with quoteBack to top

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
View user's profileSend private messageVisit poster's website
Brownside
Guest





PostPosted: Tue Mar 22, 2005 5:22 am Reply with quoteBack to top

I placed the following into my .htaccess file but it did not work:

AddType application/x-httpd-php php php3 html shtml

Here's a feed using my php template and with my SSI not showing up:
http://www.incomelink.net/feeds/rss2html.php?XMLFILE=http://news.bbc.co.uk/rss/newsonline_uk_edition/world/americas/rss091.xml

Here's a url of how the template is supposed to look with my SSI:
http://www.incomelink.net/web/plates/mainplate.php

Notice how the banners/headers/footer show up on my regular php page but when trying to use my SSI for the rss2html template they do not work at all.

All of my SSI work on my php pages with or without the: AddType application/x-httpd-php php php3 html shtml, but regardless of the .htaccess they do not seem to work with the rss2html feed template.
MacSupport



Joined: 24 Feb 2005
Posts: 314

PostPosted: Tue Mar 22, 2005 10:50 am Reply with quoteBack to top

Brownside wrote:


Is that being written to the page by your template?
View user's profileSend private messageVisit poster's website
Brownside
Guest





PostPosted: Tue Mar 22, 2005 1:26 pm Reply with quoteBack to top

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

PostPosted: Tue Mar 22, 2005 1:36 pm Reply with quoteBack to top

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
View user's profileSend private messageVisit poster's website
Brownside
Guest





PostPosted: Tue Mar 22, 2005 2:26 pm Reply with quoteBack to top

Here's the rss2html template that has the SSI working on it:
http://www.incomelink.net/feeds/feedplatetest.php


But if you try to call it through the rss2html, the SSI stop working as you can crealy see that the banners and other things that showed up in the above url, do not show up within the rss2html feed below:
http://www.incomelink.net/feeds/rss2html.php?XMLFILE=http://news.bbc.co.uk/rss/newsonline_uk_edition/world/americas/rss091.xml

I hope that's the url you needed.
MacSupport



Joined: 24 Feb 2005
Posts: 314

PostPosted: Tue Mar 22, 2005 2:41 pm Reply with quoteBack to top

Brownside wrote:
Here's the rss2html template that has the SSI working on it:
http://www.incomelink.net/feeds/feedplatetest.php


But if you try to call it through the rss2html, the SSI stop working as you can crealy see that the banners and other things that showed up in the above url, do not show up within the rss2html feed below:
http://www.incomelink.net/feeds/rss2html.php?XMLFILE=http://news.bbc.co.uk/rss/newsonline_uk_edition/world/americas/rss091.xml

I hope that's the url you needed.


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
View user's profileSend private messageVisit poster's website
Brownside
Guest





PostPosted: Tue Mar 22, 2005 2:58 pm Reply with quoteBack to top

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

PostPosted: Tue Mar 22, 2005 3:46 pm Reply with quoteBack to top

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
View user's profileSend private messageVisit poster's website
Brownside
Guest





PostPosted: Tue Mar 22, 2005 11:17 pm Reply with quoteBack to top

Okay, well thank you for your time. I will do some major research on all of this and hopefully I will figure it out.
Display posts from previous:?? ? ?
Post new topicReply to topic


?Jump to:? ?



View next topic
View previous topic


Powered by phpBB ? 2001, 2002 phpBB Group :: FI Theme