Post your best Lua script examples here

User avatar
By alonewolfx2
#3662 I checked again. 1. I saw just executed first line. I didn't saw before you say. 2. No its sending to the browser and console. But it's async I think. Sometimes I saw printed value end of html file. I don't know why. By the way The servers are just send http header and processed content of html or php files. But in your code send http header and html header and content of file. In this case printed content have two html <\html>tag and it's bad for browsers.
User avatar
By gerardwr
#3665 Thanks for your response.

alonewolfx2 wrote: I saw just executed first line. I didn't saw before you say.

Ok, good now that it's not because of my expanding your "online"

alonewolfx2 wrote: 2. No its sending to the browser and console. But it's async I think. Sometimes I saw printed value end of html file. I don't know why.

Hmmmm…. some more checking to do. The Telnet server example is using node.input to get a Lua statement and uses a node.output procedure like yours. That seems to work SYNC!?

[/quote]
alonewolfx2 wrote:By the way The servers are just send http header and processed content of html or php files. But in your code send http header and html header and content of file. In this case printed content have two html <\html>tag and it's bad for browsers.

I will put that on my todo list. The "final" version will have just .html files, and no HTML code on the "landing page" anymore. I saw in your previous example that you hade commented this "rubbish" and just fidplayed what's between the horizontal lines in my debug version. Is that what you mean?
User avatar
By alonewolfx2
#3668
gerardwr wrote:Hmmmm…. some more checking to do. The Telnet server example is using node.input to get a Lua statement and uses a node.output procedure like yours. That seems to work SYNC!?


if it sync we have problem because here is printed lines. it seems server send printed lines after for loop .
Code: Select all<html><body><BR>Hello. This HTML page contains a lua script<BR></body></html>Server ip : 192.168.2.172
>


gerardwr wrote:I will put that on my todo list. The "final" version will have just .html files, and no HTML code on the "landing page" anymore. I saw in your previous example that you hade commented this "rubbish" and just fidplayed what's between the horizontal lines in my debug version. Is that what you mean?

something like that. i think we dont have "landing page" anymore. if it has not specified page on the get request we send index.html page. and i think this lines must be changed
Code: Select alls = string.match(s,'%a+%.*%a*',4)
    if s==nil
      then  conn:send("Page : " .. "no page specified" .. "<BR>")
      --else  conn:send("Page : " .. s .. " ")
    end