时间: 2021-07-31 作者:daque
这页很大略 - 创造一个用户不妨输出消息的基础的form。form顶部的<form>标志符有两个参数:action="path/to/myscript.cgi"和method="post"。 把这个文献生存在perltour文献夹中,用文献名"test2.cgi"。 把底下代码正片到文献testform.htm中,而后把它ftp到perltour文献夹中。 <html><head> <title> my first form </title> </head><body> <form action="test2.cgi" method="post"> first name <input name="first" type=text size=25><br> last name <input name="last" type=text size=25><br> e-mail <input name="email" type=text size=30><br> <input type=submit value="test it"> </form> </body></html> 当用户点击form底部的submit按钮时,效劳器将执路途序"test2.cgi"并把用户输出的消息传播给步调。method不妨是post或get。 提防:即使你的效劳器运用cgi-bin文献夹,你的html文献中的form中的script名前应加上/cgi-bin/。比方, <form action="/cgi-bin/test2.cgi" method="post">