submit.cfm

· confusionunknown's pastes · raw

expires: 2025-11-07

 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2<html xmlns="http://www.w3.org/1999/xhtml">
 3	<head>
 4		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 5		<title>Alice's Guestbook</title>
 6	</head>
 7	<body>
 8		<cfif IsDefined("form.submit") and len(trim(form.name)) and len(trim(form.body)) and (FindNoCase("@",form.email) != 0 OR !(len(trim(form.email)))) >
 9			<cfinsert datasource="db" tablename="entries" formFields="name,website,email,body">
10			<cfoutput>
11				<h2>Thanks, #EncodeForHTML(Form.name)#.</h2>
12				<p>Your entry has been added to the guestbook</p>
13			</cfoutput>
14		<cfelse>
15			<cfoutput>
16				<h2>Unable to add</h2>
17				<p>Check that you have filled in all required fields correctly to proceed, and that all fields are of the correct format.</p>
18			</cfoutput>
19		</cfif>
20		<a href="/">Go back</a>
21	</body>
22</html>