这页很简单 - 建立一个用户可以输入信息的基本的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">
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器