
Thursday, November 03, 2005
Displaying RSS feeds in ASP pages using CaRP
CaRP is a PHP script, so naturally, using it in PHP pages is easier than in non-PHP pages. You may already know that you can use CaRP's JavaScript output option to display feeds in non-PHP pages. You may also know that if you do that, search engines won't be able to see the feed's content. You may know that with SSI, you can often #include a PHP page into another page and have the PHP code executed. But sometimes SSI #includes don't trigger the PHP code in the page that's being imported. Here's a little code snippet that I used today to import the output from a PHP script (running CaRP) into an ASP page when using an SSI #include failed to execute the PHP:
<%
Dim objHttp
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "http://example.com/feed.php", false
objHttp.Send
If objHttp.status = 200 Then
response.write(objHttp.responseText)
End If
set objHttp = nothing
%>
(8) comments
<%
Dim objHttp
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "http://example.com/feed.php", false
objHttp.Send
If objHttp.status = 200 Then
response.write(objHttp.responseText)
End If
set objHttp = nothing
%>
(8) comments