Getting RSS content into existing html page

Status
Not open for further replies.

Scrabbler

New member
Jul 20, 2006
144
2
0
Have existing html page. Have working php script to display rss feed.

How can I merge the two?

Best I can do now is have a link in the html page which then calls my php script.

I'd like to eliminate the click and have the content pulled & displayed on page load.

How can this be done?

Thanks.
S.
 


The php file will be called every time the page loads. The trick is to either cache the result of running that script, or to store the result into a database or static file (which is just about the same as caching the result). Sometimes you may want to expire a page cache and get a new result, say after every day.
 
I dont know much about PHP, but is it possible to place php in an HTML file? I was under the impression that you can place html and xhtml script in a .php file, but placing php code in a .html file wouldnt work.
 
it works, but you have to change the .htaccess (or is it php.ini??) to process .html files as .php

I'm not sure why you would want to though when you can just rename your .html page to a .php page.

In answer to the original question though, i think you're looking for "include"

see: PHP: include - Manual
 
put this line in your .httaccess file
Code:
AddHandler application/x-httpd-php .htm .html
then just add

Code:
<?php 

include("yourphpfile.php");

?>
in the htlm file where you want it to appear
 
Status
Not open for further replies.