Mailing List Archive



Back to the month index Back to the list index

David J. Hughes (bambi@Hughes.com.au)
Thu, 8 Apr 1999 09:38:56 +1000 (EST)


Date: Thu, 8 Apr 1999 09:38:56 +1000 (EST)
From: "David J. Hughes" <bambi@Hughes.com.au>
Subject: Re: Thinking out loud re: w3-msql
Message-ID: <Pine.BSF.3.96.990408092940.287E-100000@fawn>

On Wed, 7 Apr 1999, Mitch Shields wrote:

> In my limited exposure to w3-msql, I believe I have noticed that it parses
> the entire script file before sending the browser/client the result.

Yup, you are correct but you must note _parse_ not _execute_. Big
difference here.

> I was
> wondering if it would be possible to have an option of making w3-msql send
> the client each line of code as it is parsed. What I assume is that the
> browser/client will display info as soon as it is received, so if the top
> 1/2 of your document was static and the bottom 1/2 of your document was
> based on a query, the browser would display the top 1/2 while the db was
> churning on the query.

The entire script is parsed before anything is sent to the client but each
line is sent as it is executed. Internally, a hunk of vanila HTML code is
converted into a call to echo() with the HTML code as the arg. So, if you
have a hunk of HTML followed by a query, the HTML is sent to the browser
before the query is processed.

If you want to see what's actually going on in a Lite or W3-mSQL script
you can dump the pseudo code that's been generated by the parser. If you
have a W3-mSQL page called /tmp/test.msql then use

    setenv PATH_TRANSLATED /tmp/test.msql
    setenv REMOTE_ADDR 0.0.0.0
    w3-msql -d /tmp/test.msql

The -d option on w3-msql and lite produces a pseudo code dump.

The following page produces the dump below

-----
This is a test Some intro text ----- Function main() Line 4 ECHO Arg = ' Ideally, I would like to do use Javascript to update the status bar at the > bottom of the browser window during a query. Right now, the limiting factor > seems to be that the entire HTML page is generated through w3-msql, > including a completed query, and then sent to the client. This should work just fine as long as you send the javascript either as an HTML hunk or via an echo() before you start the query. Well, as long as your web server isn't buffering the output of the script that is. Bambi ... <P><!-- body="end" --> <HR> <P> <UL> <!-- next="start" --> <LI><STRONG>Next message:</STRONG> <A HREF="0032.html">John McDermon: "w3-auth 2.0.4.1"</A> <LI><STRONG>Previous message:</STRONG> <A HREF="0030.html">David J. Hughes: "Re: Platform Differences?"</A> <!-- nextthread="start" --> <LI><STRONG>Next in thread:</STRONG> <A HREF="0038.html">Mitch Shields: "Re: Thinking out loud re: w3-msql"</A> <LI><STRONG>Reply:</STRONG> <A HREF="0038.html">Mitch Shields: "Re: Thinking out loud re: w3-msql"</A> <!-- reply="end" --> </UL> <!-- trailer="footer" --> </HTML>