mg.write("HTTP/1.1 200 OK\r\n") mg.write("Connection: close\r\n") mg.write("Content-Type: text/html; charset=utf-8\r\n") mg.write("\r\n") t = os.time() if not mg.request_info.query_string then cnt = 1000 else cnt = tonumber(mg.get_var(mg.request_info.query_string, "cnt")) end cnt = 100*math.floor(cnt/100) mg.write([[ ]] .. cnt .. [[ images

A large gallery of small images:

]]) for s=0,(cnt/100)-1 do local ts = (tostring(t) .. tostring(s)) mg.write([[

page ]]..s..[[

]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[ ]]) mg.write([[
]]) end mg.write([[

Test case: all images are displayed.

]])