<title>
UIOWA UIData
</title>
<link href="/magazine/new/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript">
function validateForm()
{
if (document.Form.PostedDate.value == "")
{
alert("Please enter the date the data was posted (mm/dd/yy).");
document.Form.PostedDate.focus();
return false;
}
if (document.Form.DataImage.value == "")
{
alert("Please insert the data image.");
document.Form.DataImage.focus();
return false;
}
if (document.Form.Source.value == "")
{
alert("Please enter the Source of the data.");
document.Form.Source.focus();
return false;
}
return true;
}
</script>
<style type="text/css">
body { color: #666; }
.main { width: 800px; margin: 0 auto; }
th { color: #333; }
input { height: auto; padding: 5px!important; color: #333; }
select { color: #333; }
td {width: 160px; overflow: hidden;}
p { text-align: center;}
</style>
<script type="text/javascript" src="../../js/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../textValidator.js" ></script>
<script type="text/javascript" src="madmin.js"></script>
</head>
<body>
<div class="main">
<div style="background-color:black"><img src="Images/newlogo3.png" width="400" height="120" alt="" style="margin-left:20px"/></div>
<h2>
UIData Database Insert Form
<cfif StructKeyExists(URL, "message")>
<cfoutput><small>#URL.message#</small></cfoutput>
</cfif>
</h2>
<FORM ACTION="UIDataActionInsert.cfm" name="Form" id="Form" onSubmit="return validateForm();" METHOD="Post">
<table border="0" width="100%">
<tr>
<td align="center"><p>Date Posted (mm/dd/yy):</p></td>
<td colspan="3"><INPUT NAME="PostedDate" TYPE="text" id="PostedDate" SIZE="100%" MAXLENGTH="400"></td></tr>
<tr>
<td align="center">Data Image:</td>
<td><input name="DataImage" type="text" id="DataImage" Size="100%"> </td>
</tr>
<tr>
<td align="center"><p>Source:</p></td>
<td colspan="3"><INPUT NAME="Source" TYPE="text" id="Source" Size="100%" MAXLENGTH = "400" ></td></tr>
<td align="center"><p>Hyperlink:</p></td>
<td colspan="3"><INPUT NAME="HyperLink" TYPE="text" id="HyperLink" Size="100%" MAXLENGTH = "400" ></td></tr>
</table>
<p>
<BR>
<INPUT class="btn" TYPE="reset" NAME="ResetForm" onClick="resetFields();" VALUE="Clear Form">
<INPUT class="btn primary" TYPE="submit" NAME="SubmitForm" VALUE="Submit Data">
</p>
<br>
<p>
<a href="https://mysite/administration/UIData/index.cfm">Go back to index</a> </p>
</body>
</html>
这是我要插入到我的数据库中的表单的代码,但是无论何时提交我都得到500内部服务器错误,我没有看到我做错了什么,Dreamweaver将我的表单初始化标记为无效?
然后这是我的插入操作,我没有看到导致此错误的原因。
<cfquery NAME="AddData" datasource='UIAAWeb'>
Insert Into UIData(PostedDate, DataImage, Source, HyperLink)
Values('#Form.PostedDate#', '#Form.DataImage#', '#Form.Source#', '#Form.HyperLink#');
</cfquery>
<!--, PostedDate, DataImage, Source, Hyperlink---->
<cfquery name="getID" datasource="UIAAWeb">
select * from UIData
where DataImage = '#Form.DataImage#'
</cfquery>
<cfoutput query="getID"><cflocation url="index.cfm?message=DataImage '#DataImage#' With ID #DataID# Successfully Created"></cfoutput>