Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter wpuser

    (@wpuser)

    Thank you for feedback.
    My main related problem (not mentioned here) was caused by the fact that my main page is in ASP so I can’t directly call PHP from it. After some Internet search I actually tried a 2-step solution that works allowing me to use output of get_archives() function in ASP page. I posted details of it in another post. If anybody interested, I can repost it here.

    Thread Starter wpuser

    (@wpuser)

    Sorry for this long post because it does not deals directly with the WordPress issue but it may be useful for those who want their recent headers to appear on ouside ASP page (which does not allow to execute PHP code directly). Apparently, the solution based on a code I found, requires MS Server XMLHTTP.3.0 present.
    In short, the problem was resolved by “wrapping” PHP output with ASP code as follows:
    Step 1. Create recent_headers.php file containing:
    <?php
    require(‘wp-blog-header.php’);
    get_archives(‘postbypost’,’5′,’html’);
    ?>
    Step 2: Add this code to your ASP file:
    <%
    Function GetURL(str_URL)
    Set obj_XMLHTTP = Server.CreateObject (“MSXML2.ServerXMLHTTP.3.0”)
    obj_XMLHTTP.Open “GET”, str_URL, False, “”, “”
    obj_XMLHTTP.Send()
    While obj_XMLHTTP.readyState <> 4
    obj_XMLHTTP.waitForResponse(10000)
    Wend
    If Err.Number = 0 Then
    If obj_XMLHTTP.Status = 200 Then
    str_GetURL = obj_XMLHTTP.ResponseText
    Else
    str_GetURL = “Bad URL”
    End If
    Else
    str_GetURL = “Bad URL”
    End If
    Set obj_XMLHTTP = Nothing
    GetURL = str_GetURL
    End Function
    %>
    <%
    str_PHPOutput = GetURL(“http://yoursite.com/wp-files/recent_headers.php&#8221;)
    %>
    <%= str_PHPOutput %>
    Thank you.

    The same problem happened to me few minutes ago and remains. Is it fair to say that the message will be generated whenever there any temporary MySQL problem on the hosting site? If so, is there any error trapping possible to prevent that long (and confusing for an average user) message from appearing?

    Thread Starter wpuser

    (@wpuser)

    I like the idea of using the specified get_recent_posts PHP function but I’ve forgot to mention that my main page uses ASP functions and .ASP extention. Will it be still parsed by the PHP server? Is there a way to create some kind of SSI that could include the text created by get_recent_posts in the .ASP file before it’s sent to ASP server?
    Thank you…

Viewing 4 replies - 1 through 4 (of 4 total)