comparison src/choose_server.html.luan @ 12:3e2cb946d511

form handling
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 30 Oct 2023 14:59:45 -0600
parents 62dd23f0b549
children af2b95854072
comparison
equal deleted inserted replaced
11:62dd23f0b549 12:3e2cb946d511
84 <% 84 <%
85 for _, server in ipairs(servers) do 85 for _, server in ipairs(servers) do
86 local id = server.id or error() 86 local id = server.id or error()
87 local name = server.name or error() 87 local name = server.name or error()
88 local icon = server.icon 88 local icon = server.icon
89 local url = "add_server.html?id="..id.."&name="..url_encode(name)
90 if icon ~= nil then 89 if icon ~= nil then
91 url = url.."&icon="..icon 90 local url = "add_server.html?id="..id.."&name="..url_encode(name).."&icon="..icon
91 %>
92 <p><a href="<%=url%>"><%=html_encode(name)%></a></p>
93 <%
94 else
95 %>
96 <p><%=html_encode(name)%> (missing icon)</p>
97 <%
92 end 98 end
93 %>
94 <p><a href="<%=url%>"><%=html_encode(name)%></a></p>
95 <%
96 end 99 end
97 %> 100 %>
98 <% footer() %> 101 <% footer() %>
99 </body> 102 </body>
100 </html> 103 </html>