<!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1><%=title%></h1> <table> <tr> <td> <div> <p><a href="https://www.jb51.net/" >home</a></p> <p><a href="https://www.jb51.net/mult" >Multiplication</a></p> <p><a href="https://www.jb51.net/square" >Square</a></p> <p><a href="https://www.jb51.net/factorial" >Factorial</a></p> <p><a href="https://www.jb51.net/fibonacci" >Fibonacci</a></p> </div> </td> <td></td> </tr> </table> </body> </html>
home.html
<% include layout.html %> <p>Math Wizard</p>
mult.html
<% include layout.html %> <% if (req.a && req.b){ %> <p> <%=req.a%> * <%=req.b%> = <%=req.result%> </p> <% } %> <p>Enter numbers to multiply</p> <form action="https://www.jb51.net/mult" method="get"> A: <input type="text" /><br/> B: <input type="text" /> <input type="submit" /> </form>
还有其他一些页面就不一一列出来了,都大同小异