I'm assuming that the form is posting to itself since you did not give the
name of the file. I will give you back your code with some changes and some
clarification on variable scoping by scoping explicitly. It seems that you
were also filling the name attribute in your forms with wha.t should be the
value attribute. I replaced "name" with "value" and added what I assume is
the correct name attribute for each one. This isn't tested but I hope you
get the idea.
Perhaps I'm a bit anal but I like to scope all variables that aren't
"Variable" scope. It makes things easier to understand and ColdFusion
processes explicitly scoped variables faster.
Hope this helps.
<cfparam name="form.Name" default="">
<cfparam name="form.Email" default="">
<cfparam name="form.Location" default="">
<cfparam name="form.URL" default="">
<cfparam name="form.Section" default="">
<cfparam name="form.Contribute" default="">
<cfparam name="form.Comments" default="">
<html>...
<td width="50%" valign="top" align="left">
<font face="Arial, Helvetica, sans-serif" color="#ffffff"><b>Name or
Alias:</b></td>
<td width="50%" valign="top" align="right">
<cfform action="guest.cfm" method="post">
<input type="text" size="25" value="#form.Name#" name="name"><br><br>
<input type="text" size="25" value="#form.Email#" name="email"><br><br>
<input type="text" size="25" value="#form.Location#"
name="location"><br><br>
<input type="text" size="25" value="#form.URL#" name="url"><br><br>
<input type="text" size="25" value="#form.Section#" name="section"><br><br>
<input type="text" size="25" value="#form.Contribute#"
name="contribute"><br><br>
<input type="text" size="25" value="#form.Comments#"><br><br>
<input type="submit" name="submit" value="submit">
</cfform>
<cfif isdefined("Form.Submit")>
<cfquery datasource="Northwind">
INSERT into Guestbook(Name,Email,Location,URL,Section,Contribute,Comments)
Values('#form.Name#','#form.Email#','#form.Location#','#form.URL#','#form.Se
ction#','#form.Contribute#','#form.Comments#')
</cfquery>
</cfif>
</td>
</tr>
</table>
<br></td><td width="20%" valign="top" bgcolor="#ffffff"><br></td></tr>
<tr>
<td width="20%" valign="top" bgcolor="#ffffff">
<br></td>
<td width="60%" valign="top" bgcolor="#ffffff"><br></td>
<td width="20%" valign="top" bgcolor="#ffffff"><br></td>
</tr>
</table>
<cfoutput query="getguest">
<blockquote>
#getguest.date#<br>
<b>#getguest.name#<br>
<cfif #getguest.email# is not ""><a href="mailto:#getguest.email#">Email
Me</a></cfif><br>
#getguest.location#<br>
<cfif #getguest.URL# is not ""><a href="#getguest.URL#">Visit My
Website</a></cfif><br>
#getguest.section#<br>
#getguest.contribute#
#getguest.comments#</b>
</blockquote>
<hr width="50%" align="center">
</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists