我决定用 Linux-form 。
1,不知如何设置其中的文件 server-apply.htm 才能实现对表单中的必填项和选填项的控制。
2,不知如何设置其中的文件 server-apply.txt 才能将表单发到我网站邮箱。
我下面的设置不正确,请帮忙修改:
(1)server-apply.htm 文件:
<html>
<head>
<title>Hotel Reservation Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.size01 { font-size: 1px}
.size09 { font-size: 9pt}
.size10 { font-size: 10pt}
.color01 { color: #666600}
a:link { font-size: 9pt; color: #000000; text-decoration: none}
a:hover { font-size: 9pt; color: #666600; text-decoration: underline}
a:visited { color: #000000; font-size: 9pt; text-decoration: none}
.color02 { font-size: 9pt; color: #990033}
-->
</style>
</head>
<body bgcolor="#FFFFFF" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div align="center"><br>
<br>
<br>
<form name="reg_order" method="POST"
action="http://www.niceyangshuo.com/cgi-bin/cgiemail/server-apply.txt" onSubmit="return test(this)">
<input type="hidden" name="success" value="http://www.niceyangshuo.com/success.htm">
<input type="hidden" name="required-to" value="
root@niceyangshuo.com">
<input type="hidden" name="subject" value="Hotel Reservation Form">
<DIV align=center>
<FORM name=reg_order onsubmit="return test(this)" action=http://www.niceyangshuo.com/cgi-bin/cgiemail/server-apply.txt method=post><INPUT type=hidden value=http://www.niceyangshuo.com/success.htm name=success> <INPUT type=hidden value=root@niceyangshuo.com name=required-to> <INPUT type=hidden value="Hotel Reservation Form" name=subject>
<DIV align=left>
<TABLE class=size09 borderColor=#666600 cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> </FONT><FONT color=#000000><U><FONT face=Arial size=5>Xihe Hotel Reservation Form</FONT></U> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> </FONT><FONT face=Arial color=#000000 size=2>One of the guest's full name(same as the passport): </FONT><FONT color=#666600> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> <INPUT size=25 name=contact> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> Email address: </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> <INPUT size=25 name=address> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> Another email address(if you have):</FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> <INPUT size=25 name=tel> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> How many people altogether in your group?<INPUT style="WIDTH: 101px; HEIGHT: 22px" size=12 name=fax></FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> Arrival Date?<INPUT size=25 name=email></FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> </FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> How many nights will you stay in our hotel?<INPUT style="WIDTH: 101px; HEIGHT: 22px" size=12 name=fax></FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> How many <STRONG>double</STRONG> rooms <STRONG>without view</STRONG> do you want? </FONT><INPUT maxLength=10 size=10 name="Flight Number"></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> How many <STRONG>double</STRONG> rooms <STRONG>with view</STRONG> do you want? </FONT><INPUT maxLength=10 size=10 name="Flight Number"></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> How many <STRONG>connubial</STRONG> rooms <STRONG>with view</STRONG> do you want? </FONT><INPUT maxLength=10 size=10 name="Flight Number"></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT face=Arial size=2> Would you need a <SPAN style="FONT-WEIGHT: bold">taxi pickup</SPAN> from the Guilin Airport (<SPAN style="FONT-WEIGHT: bold">yes</SPAN> or <SPAN style="FONT-WEIGHT: bold">no</SPAN>)?<INPUT style="WIDTH: 59px; HEIGHT: 22px" maxLength=10 size=5 name="Flight Number"></FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20></TD></TR>
<TR>
<TD class=size9 align=left width="73%" height=20><FONT color=#666600> <FONT face=Arial color=#000000 size=2>Flight Number?</FONT><INPUT size=25 name=member> </FONT></TD></TR>
<TR>
<TD align=left width="73%" height=20></TD></TR>
<TR>
<TD align=left width="73%" height=20><FONT face=Arial size=2> What time will you arrive at the Guilin airport? <INPUT maxLength=20 name="Arrival Date"></FONT></TD></TR>
<TR>
<TD align=left width="73%" height=20></TD></TR>
<TR>
<TD align=left width="73%" height=20><FONT face=Arial size=2> Your special requirements:</FONT></TD></TR>
<TR>
<TD class=size9 align=left width="73%"><FONT color=#666600 size=2></FONT><FONT color=#666600> </FONT><FONT color=#666600 size=2><TEXTAREA name=note rows=5 cols=35></TEXTAREA> </FONT></TD></TR></TBODY></TABLE></DIV>
<DIV align=left> </DIV>
<DIV align=left> <INPUT style="WIDTH: 43px; HEIGHT: 23px" type=submit value=send> <INPUT style="WIDTH: 41px; HEIGHT: 23px" type=reset size=16 value=reset> </DIV>
<DIV></DIV></FORM>
<p>
<script language="JavaScript">
<!--
function test(theform)
{if (theform.contact.value.length<1)
{alert("Please write down your name!");
theform.contact.focus( );
return(false);}
if (theform.email.value.length<2|theform.email.value.indexOf("@")==-1|theform.email.value.indexOf(".")==-1)
{alert("Your right E-mail address please!");
theform.email.focus( );
return(false);}
}
//-->
</script>
</p>
<p> </p>
</div>
</body>
</html>
(2)server-apply.txt 文件:
From:
root@niceyangshuo.comTo:
root@niceyangshuo.comReply-to:root@niceyangshuo.com
Subject:Hotel Reservation Form
--------Hotel Reservation Form-----------------------
联系人: [contact]
电子邮箱: [email]
Another email address
How many people
Arrival Date
How many nights will you stay
How many double rooms without view
How many double rooms with view
How many connubial rooms with view
need a taxi pickup
Flight Number
the time of arrival
Your special requirements:
[note]
大家帮帮忙吧。将感激不尽。
-------------------------------------------