我目前在我的最后一年项目中遇到问题,其中一个预订表单没有时间输入,我如何插入代码并将其与我的数据库集成?
这是我的预订表格代码:
<div class="a"> <b> Fill In The Appointment Form </b> </div> <br>
<hr size="3" width="50%" color="black">
<form action="pros_form_app.PHP" method="post" enctype="multipart/form-data" name="form1">
<br> <br> <br> <br> <br>
<table width="700" bgcolor="#FFFFFF" border="1" bordercolor="#000000" align="center" background="img/bluee.png">
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> FirsT NAME </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#FFFFFF"><input name="FirstName" type="text" id="FirstName" size="50" placeholder="Your First name.." /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> LAST NAME </b> </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#FFFFFF"><input name="LastName" type="text" id="LastName" size="50" placeholder="Your Last name.." /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> EMAIL </b> </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#FFFFFF"><input name="Email" type="text" id="Email" size="50" placeholder="Your Email.." /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> DATE </b> </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#b3d9ff"><input type="Date" id="Date" name="Date" placeholder="Select a date.."></td>
</tr>
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> APPOINTMENT </b> </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#FFFFFF">
<select id="Appointment" name="Appointment">
<option value="health"> Premium Healthcare </option>
<option value="weight"> Weight Loss Program </option>
<option value="wrinkles"> Wrinkles and Fine Lines </option>
<option value="hair"> Hair Loss Treatment </option>
</select>
</td>
</tr>
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> MESSAGE </b> </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#FFFFFF"><input name="Message" type="text" id="Message" size="500" placeholder="Your Message.." /></td>
</tr>
<tr>
<td colspan="10" bgcolor="#c5e8ec" align="center">
<br>
<input name="hantar" type="submit" id="hantar" value="SUBMIT" />
<br> <br>
</td>
</tr>
解决方法:
<tr>
<td colspan="3" bgcolor="#3399ff"> <b> Arrival </b> </td>
<td width="10" bgcolor="#FFFFFF">:</td>
<td bgcolor="#FFFFFF"><input name="time" type="text" id="time" size="50" placeholder="What time are you checking in?"/></td>
</tr>
在你的数据库中把它当作varchar,如果你只需要有关时间的信息而不用它做任何其他事情,那么在这种情况下我不会建议varchar