PDA

View Full Version : .php & .html compatibility


ssskaya
11-28-2002, 01:57 AM
I have inserted a php poll to my website.

And since, browsers treat .php files the same as .html files, I thought nothing was going to change.

But my Reuters is not working any more.

Below is the script for Reuters. (It is a yahoo website add-on)

Why is it not working any more? And what should I do to make it work again?

Thanks.


<!-- Here is the code for Business from Reuters --> <!--#ynews news="rb" n="4" hbc="3399ff" hfc="FFFFFF"
hff="Arial" hfs="2" ibc="ccccff" ifc="0000ff" iff="Times New Roman" ifs="3"
udd="1" ufc="FFFFFF" uff="Arial" ufs="2" ctry="us" tz="us" -->

Dylan Leblanc
11-28-2002, 07:42 AM
Is #ynews for server side includes (SSI) ?

ssskaya
11-29-2002, 11:30 PM
yes, sure.

everything was ok before I renamed my index.html to index.php.

it still works when I rename it back to index.html, but I can't use the php functions this way of course.

brothercake
11-30-2002, 12:15 AM
You can associate the .html extension with php, in a root .htaccess file:

AddType text/html .html
AddHandler application/x-httpd-php .php .phtml .html

firepages
11-30-2002, 12:42 AM
you won't be able to mix SSI with PHP (perhaps with apache2 but not yet AFAIK)

Spookster
11-30-2002, 01:16 AM
Originally posted by firepages
you won't be able to mix SSI with PHP (perhaps with apache2 but not yet AFAIK)

Could you put the SSI into another page and name it .shtml and then include that page into your PHP page? Like:

include "yaks.shtml";

Would it execute the SSI before merging it into the php page?

firepages
11-30-2002, 01:41 AM
you have to use virtual() for including CGI or SSI stuff eg:

virtual('some.shtml');

but that does not work for me on win32 , not tried on *NIX yet , and adding the absolute path causes Apache to report that it cant find the file ! weird.

brothercake
11-30-2002, 03:33 AM
I did it the other way round once

<!--#include virtual="navbar.php"-->

where navbar.php had an include() on it. That worked fine - but navbar.php didn't have access to the page's variables when it was parsed.

Ökii
11-30-2002, 06:35 PM
why not just take that extra step and convert totally to php - leave that ol' SSI stuff behind.

Spookster
11-30-2002, 09:41 PM
Originally posted by Ökii
why not just take that extra step and convert totally to php - leave that ol' SSI stuff behind.

That is the problem ssskaya is having. They want to convert to php but the news service they are using requires their content to be inserted via SSI.

ssskaya
12-01-2002, 05:07 AM
so Spookster, what are the possible ways (if any) to overcome this problem?

Spookster
12-01-2002, 05:53 AM
The first and most obvious choice would be to find a different news service that does not require you to integrate into your site via a SSI. The problem here with using SSI is that the SSI has to be parsed by your server and will not do that without knowing to do that. When you have a PHP page it gets sent to the PHP engine to be parsed so the SSI doesn't get parsed by the server as it should be parsed.

Basically it will have to exist in a page with a .shtml extension or as it seems yahoo servers are set up to parse them in .html as well. So another option might be to use frames. Possible solution could be use of an IFRAME (inline frame) that can be seamlessput into the page. However though IFRAMES will not work in NS4.x but will work in IE and NS6+ and Mozilla. You could probably use an alternate of ILAYER for NS4.x users though.

ssskaya
12-04-2002, 02:16 PM
thanks for the replies.

SO: if anybody knows a "real-time" news add-on service which is operable under .php (free or not), please let me know. I will highly appreciate that. Thanks again!

brothercake
12-10-2002, 11:21 AM
You could try http://www.moreover.com/ - I believe their's is a javascript include

ssskaya
12-11-2002, 04:57 AM
I have already checked them out. They seem to be very good. BUT it says that their pricing starts from $6K a month! So it's incredibly expensive for me.