Thank God!!! I've been searching for this exact type explanation of how to run php through HTML pages for 2 solid weeks, now. THANKS EVER SO MUCH for posting this!!!!!
Thank-you for this tutorial! One question...
So you showed how to get it to process for a single file, and you showed how to get it to process site-wide... is there a way to get it to process for just a directory? e.g. I have a directory called mysite.com/blog. How would I get it to just process in /blog and all subs of /blog?
Ah, good question. To process one directory and it's subdirectories, make a .htaccess file in that directory and use the site-wide style setting.
My host uses linux servers & does not support .htaccess files. Is there anything you can think of that I might try, to use php within my html file?
how do I creat a .htaccess .
With which program can I create this file there is none in my webserver
You can create a .htaccess file using any text editor that can save files as plain text.
I am in the process of setting up a feed. Whjat I haven't found is how to formate what the feed will look like on my page. I need it to go into a specific area to match my page. Is this possible?
Information about display formatting is here. I'm afraid I'm not sure what you mean by "I need it to go into a specific area". Just put the code the calls CaRP in the spot where you want the feed to appear. Does that answer the question?
You are a GENIUS!
My WebMistress the "NewzMom" is going to get a chuckle out of this! -- Jim
Brilliant work! I thank you and congratulate you all at the same time. I happily paid the 29/30 dollars for the evolution version of carp. Easily worth it.
It will do well in helping me flesh out www.movie-career.com and it's so easy!!
Good things are coming.
How come alot of rss feeds are in a format that looks similar to html which start with a RSS tag
instead of an url that i have in my code that was produced by the configuration php
how do we input that carp?
Great work. Everythihg is working really well, but now I want to use the apache capability to add Include files. Naming my files with .html doesn't work to include an include file into a page, but when I use the .shtml extension, I get the include, but loose the CaRP feed and get this error code where the feed should be:
# '); CarpConf('aitems',''); // put "list item" tags before and after each item CarpConf('bi',''); CarpConf('ai','
'); CarpCacheShow('http://rss.indeed.com/rss?q=marketing+title%3Adirector&l=Los+Angeles&limit=50&jt=fulltime'); ?>
What's happening is that the PHP code in the include file is not getting executed--the code is just getting displayed. Two things to do:
1) Make sure the filename extension for the include file is ".php".
2) Try writing the include tag in a few different ways as mentioned at the bottom of this article (use #include, #exec, file=, virtual=, cgi=...). Some servers work with one combination of those but not with others.
Sorry, but it seems I am really nuts.
Installed everyting and my page shows just the code I copied from the istallation page, not even an error message.
// Add any desired configuration settings below this line using "CarpConf" and other functions
hey, so i'm trying to get this .htaccess thingy going...i'm using frontpage so could this be causing me problems? 2 things...
a) do i literally type:
AddType application/x-httpd-php .html
or do i modify or replace "add type"
b) my server seems to like deleting any .php files i try and save on it...erm why?!
How do i get the description text to the colour i want?! and able to be picked up by the search engine spiders?
Answers to recent questions:
1) Nothing shows up--not even errors: does the name of the page you pasted the code form the installer into end with ".php"? If not, what steps have you taken to try to get your webserver to process the PHP code?
2) .htaccess: Probably add that line to your .htaccess file, but it depends on what you already have in it. What AddType lines do you already have?
3) Deleting PHP files: I have no idea. That's pretty bizarre. I'd recommend contacting your hosting provider about that.
4) Description text color: try this (using whatever color you want):
quite simply antone, your a legend. one more thing though, testing out my rss feeds now they're up and running, but i cant stop the border from spilling into the rest of page in some places (take a look at the bottom of my test page at: http://www.stleonardscarboot.co.uk/testing/indextest.php)
any idea how to stop this?
oh, and for some reason the whole lot seems to want to stick to the left hand side of the page despite everything I can think of to align it on the right!
sorry to be a pain...
ive done everything right as far as setting up carp but i dont know how to get rss feeds from other pages to my site...its an html file and i ran the (AddType application/x-httpd-php .html)in my htaccess but i dont know wut to do after that ...can someone please help?
I managed to install carp in about 10 minutes, great script!
But, I have a problem:
I am using AdSense codes on my index page, but it shows wrong keywords.
If I add index.php like this:
everything looks ok.
What is the problem?
I have seen this in other pages too.
i have also installed carps on my server to feed some news to my article directory ...Installation was a breeze...no error messages. But it does not display any news on my site. I have used the following code:
// Add any desired configuration settings before CarpCacheShow
// using "CarpConf" and other functions
have replace <> to # for displaying it here
Did I do anything wrong...??
any help is appreciated ...
You are the man with the answers! Everything works great. I'm setting my site up with .htaccess so I can keep my indexed pages the same name with .html extensions. But when I add the Addtype line to the .htaccess file, it gets rid of my left navigation (put there using SSI). I have another line in the .htaccess that uses Addtype. Is this the problem? Thank you.
I think it is a great software and installs real easy. I also used the .htaccess file. However, it seems only working for my index file. All my other files in the same directory comes up as blank. I checked the source code and they are blank. But, I view the file in ftp folder and they all look normal and identical to the index page in term of formatting. Can you help me out? Thanks.
My htaccess file was completely empty.
I added the one line
AddType application/x-httpd-php .html
and it crashed my site.
I changed the line to
AddType x-httpd-php .html
and at least my web pages display.
Now for the next problem -
my server is not recognising the php statements. ???
The answer for me was
not AddType, or ForceType.
My host says that their .htaccess only supports AuthType.
Is that the same as AddType?
I too am having difficulty with .htaccess. I didn't have a .htaccess file on my (Apache/PHP4) site, so I figured I was safe writing one with a single line in it. Added AddType application/x-httpd-php .html and saved to root as ASCII.
When I tried to open my site in Firefox it wanted to download every page and open locally, same with IE.
Tried replacing AddType with AddHandler and everything is normal except no output from CaRP. Wrote a .php page and CaRP works fine there, but I want to add to existing .html and preserve the links. Any ideas what might be going on?
I am currently using FrontPage 2000, would that have any impact?
Antone, This looks like a great application. I'm testing it out but I ran into a seemingly simple issue I can't resolve:
It works great on .php files, I followed your instructions for use in a .htm file and it's not recongizing the php script. I have a one line .htaccess in the same root directory with the line "AddType application/x-httpd-php .html"
I'm using a shared 1and1 hosting account.
Can you point me in the right direction? This is a stupid question but I just throw the php code in my .htm file, right? There's nothing "special" I have to do to the code when it's in my htm file?
Thanks in advance,
I'm the Webmaster of BestWebsites.com.my. I had bought tons of books about RSS stuffs. The more I read the more confusions.
Thanks to a set of videos by Louis Allport entitled "How To Add Automatically Updating Content To Your Website" I was able to learn about CaRP. To those having blur eye sight, almost looks like "crap" but believe me CaRP is a ton of precious diamonds.
I read Apache's documentation here http://httpd.apache.org/docs/1.3/howto/ssi.html. As far as I understand, the principle is how to tell the Apache server to also "execute" your .html files, not only "read" it as usual.
In that document, the instruction is for .shtml files, which is in your .htaccess should be:
AddHandler server-parsed .shtml
I think, in case of .html it should be:
AddHandler server-parsed .html
This will tell Apache server to parse ALL .html files, even if they don't contain any #include directive. This gives additional load to your server and can slow things down quite a bit; so, is not a good idea.
If only a few .html files contain #include directive, best is using this method:
1) in your .htaccess write this line:
This will tell Apache to parse only those .html files that contain #include directive.
2) Make those .html files "executable", by changing their mode (atributes):
chmod +x pagename.html
Hope this helps.
Hi Steve O, from July 16
I remember I had the same outcome - blank space where the feed should have displayed.
I think what solved that one for me was setting the permissions of the web page on the server to 755.
(You probably tried that tho')
I'm having a hard time getting a feed to display on a shtml page. I can get it to display on a php page just fine. I've tried all kinds of SSI variables, but I think it may be something in my htaccess file. Can someone take a look and let me know if there is something else I can try? Thanks. Here's what's in my .htaccess file:
AddType text/html .shtml
AddHandler server-parsed .shtml
Note: the last two lines have the carets around them.
Parse error: parse error, unexpected $ in /homepages/0/d175375565/htdocs/weather/index.php on line 90
I am using Doster as a host and a linux account. I had to add
AddType application/x-httpd-php .php .html
to my .htaccess file for this to work.
I have installed CARP and it is working fine but I am facing problem with .htaccess fiel as I want to run the php script in html file. I have created .htaccess file with the given code and uploaded it to wwwroot. It display the html part but doesn't show the rss feed. Do I need to change somehting...plz advise
Frontpage users for .html , put "XBitHack on" in your .htaccess , changemod of page to 777. Then use <!--#include virtual="rssfeed.php" -->
where you want feed to appear.
.htaccess should look like this:
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
deny from all
allow from all
<Limit PUT DELETE>
deny from all
I hope that helps. working page http://pattayacitythailand.com/welcome.html
change mod to 755 and not 777 like I said before.
Re: 1and1 hosting on Linux.
Found the key FAQ at: http://faq.1and1.com/scripting_languages_supported/php/7.html
All you do is place:
AddType x-mapp-php4 .html .htm
In your .htaccess file…
Then run the setup program:
And copy and paste the code that appears at the bottom into the web page you want to display the feed in.
OK so I have not yet seen anyting specific to Word Press. I am trying to use Carp to put feed on WP pages. No luck. Changed the htaccess. no luck.
Hmm what to do. Tried putting the feed in my sidebar.php to see if it would fly. Nope crashed my sidebar...
I was having a problem getting my .php file to parse also. I tried adding the recommended commands to the .htaccess file which didn't work. The solution for me was to go to my website administration panel and go to the "handlers" and add a special handler for .htm .html and select server-parsed. Hope this helps someone.
Do you offer installation service please?
I understand it won'y be free?
I cannot get it to work...
Thanks a lot!
I am now officially beating my head on the wall.
To begin with, I am a PHP virgin. I have previously depended on a 3rd party service for this function called rssfeedreader.com. They have a site where I enter the name of the feed and check off various parameters, and they create the php script on the fly. I copy the bugger onto my site with Frontpage, save the page as .shtml, with SSI turned on, insert the tag onto the page (which this blog won't let me display here...) and BADDA-BING! The sucker works.
But, it runs though their server, places an ad on it, and I'd just like more control.
What I want to know is, where do I list my feeds? Do I open carp.php, hunt down one of the functions and insert them there? Do I create new php files for each feed, like I did with the other service?
Have mercy on me, a newby... (smites chest)
I had No Problem with this set-up, (thank the lord). My only question is, when I changed my .html pages to .php the only way they display is by having both php and html extensions in the url? Example; www.mysite.com/another-page.php.html Is this normal???
THANK YOU, THANK YOU, THANK YOU, thank you a thousand times!!!!!!!
I have tried 50 ways to Sunday to fix a specific problem on my website that precluded me from selling ads via Text Link Ads.com but thanks to your simple fix, I have solved this extremely frustrating problem!
I have little programming knowledge so everything I could find was a puzzle to me until I found your site.
Thanks a million!!!!!
#1 Instructions for adding PHP code to an HTML site;
PHP scripts do not automatically work on html pages. If you have an HTML or (.HTM) based site, in order for PHP scripts to run on your .htm or .html pages you have a 2 options or you can add them both;
For Apache Servers Edit your .htacess with:
AddType application/x-httpd-php .htm .html
Then Add the php code from the reader directly to your html pages
Addhandler application/x-httpd-php .html .php
I realized that my servers dont use Apache. do you have or know where I could get an IAS workaround?
I solved my display problems by changing permissions on the CARP folder to 755 including all sub folders and files. Before I was only getting 3 errors instead of the news feed.
After I switched servers I could no longer use the "AddType" option, and AddHandler didn't work either. What did work was moving all the CaRP PHP code to a new file "stories.html" and then just using the one simple #include line 'virtual="stories.php"' on the html page I wanted the feed. (I also had to reinstall carp because in the upgrade to the new server there was a glitch in the cache folders/files that cleared on reinstallation.) In a way, I like this alternate arrangement better than the old AddType way.
I too am having .htaccess problems.
my .htaccess file:
AddType application/x-httpd-php .html
Uploaded in acsii mode, but still get 500 Internal Server Error
I too get an internal server error.
I purchased carp koi and Grouper a couple of months ago and still haven't managed to get Carp working. I need some help here.
I've tried everything but no success. I've tried not to ask for my money back because I and a solution, not a refund.
p.s. do these comments get replies? I haven't seen any for ages.
Is the fcat that I use subdomains of any relevance?
Can this be implemented in .html pages under Windows IIS?
Finally! Thanks for all of you posting. What finally worked on my htm page was:
Addhandler application/x-httpd-php .htm .php
I have tried everything. My site is hosted by Aplus on an Apache server and I'm trying to add a php rss feed to an html page. I even made the same page on shtml. I have tried all the combinations of Addtype, Addhandler etc. Nothing worked! I can finally see a line of giberrish with weird characters on the shtml page but that is a far cry from an rss feed.
Let's see. I bought Crap and it was easy to install, had trouble getting it to work, read every post on here. The problem I'm having is that every time I load my website now I get a download prompt? Not what I was wanting to accomplish. I notice that no one has posted here for three months and the master himself "Antone" hasn't been around for almost 2 years. Can you say refund?
You should be asking your support questions in the forums: http://forums.geckotribe.com/
Great support article for Carp installation. If you have many pages, updating all links to php can be time consuming. Enabling php on non php pages can be a snitch using this information.
Web Site Design Kent