<--- NEW FILE: this is the form processor that gets info from an HTML form I call it ProcessNewEntry.cfm--->
<CFSET rlink = "">
<CFLOOP INDEX="R8ix" FROM="1" TO="24">
<CFSET rlink = rlink&Mid('abcdefghijklmnopqrstuvwxyz123456789',RandRange('1','35'),'1')>
</CFLOOP>
<---First a random string is created and assigned to the variable rlink--->
<---I use at least 24 characters in the string so there is minimal chance of duplicates --->
<---You could build in a query to make sure there are no duplicates, but with 24 random characters what are the chances really --->
<cfquery name="[queryname]" datasource="[dsn]">
INSERT INTO ajetdb (link)
VALUES
('#rlink#')
</cfquery>
<---Then the form variables are inserted into the db [they've been removed here] and the link is inserted as well --->
<CFIF email is "">
<CFLOCATION URL="somepage.htm">
<---If no email was provided then skip this part --->
<CFELSE>
<---If email was provided then email them a welcome letter with a link to their own info --->
<CFMAIL
to="#email#" From="Valid-From-Address <email@domain.com>"
Subject="Update">
Your letter here.
<---Simply add the link variable to the end of the link --->
http://www.somelink.com/update-details.cfm?link=#rlink#
<cfmailparam name = "Reply-To" value = "email@domain.com">
</cfmail>
<CFLOCATION URL="somepage.htm">
<!--- Once it's over you are redirected somewhere--->
</CFIF>
<--- NEW FILE: This is the page from the link above so here it is called update-details.cfm--->
<--- It's waiting for the URL with the LINK at the end--->
<CFQUERY
name="[queryname]"
datasource="[dsn]">
Select * from [tablename] where link='#link#'
</cfquery>
<---The URL has ?link= on it so this page is looking for that link and will pull up the info based on it --->
<html>
<head>
<title></title>
</head>
<body>
<p align="center"><b><font size="4">Please update your information:</font></b></p>
<CFOUTPUT query="[queryname]">
<form method="POST" action="processupdate.cfm?id=#id#">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="45%" id="AutoNumber2">
<--- The HTML form will be populated with the person's individual info --->
<--- This is done by making the value of the textbox a CFOUTPUT variable--->
<tr>
<td width="50%" colspan="2"><b>First Name:</b></td>
<td width="50%">
<input name="firstname" value="#firstname#" size="20" style="float: right" tabindex="1"></td>
</tr>
<tr>
<td width="50%" colspan="2"><b>Last Name:</b></td>
<td width="50%">
<input name="lastname" size="20" style="float: right" value="#lastname#" tabindex="2"></td>
</tr>
<tr>
<td width="50%" colspan="2"><b>Gender:</b></td>
<td width="50%">
<input name="gender" size="20" style="float: right" value="#gender#" tabindex="3"></td>
</tr>
<tr>
<td width="50%" colspan="2"><b>Partner Name:</b></td>
<td width="50%">
<input name="partnername" size="20" style="float: right" value="#partnername#" tabindex="4"></td>
</tr>
<tr>
<td width="50%" colspan="2"><b>Email:</b></td>
<td width="50%">
<input name="email" size="20" style="float: right" value="#email#" tabindex="5"></td>
</tr>
</cfoutput>
</table>
</center>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
Date added: Wed. March 31, 2004
Posted by: Rhino | Views: 10253 | Tested Platforms: CF5 | Difficulty: Intermediate
Forms
Mail
 |
Form with 2 Submit Buttons
An easy way to have a form with 2 or more submit buttons where each one does a different thing. One can count a rows in a DB, then next can actually submit the query. Possibilities are limitless. - Date added: Mon. October 9, 2006
Enter-Update same form
I hate creating duplicate forms where one is for entry and an identical one is for udpating. This code lets you use one form for both purposes. - Date added: Wed. April 7, 2004
Use checkboxes on update pages
Do you have an update page and want to use checkboxes on the page? This tutorial will go over the two steps needed. - Date added: Wed. March 31, 2004
User Authenication - ADMIN area
This script provides a simple admin area for the login script written by Pablon on this site. You can list, add, change pass, and delete users. - Date added: Mon. March 29, 2004
Website Monitor
Do you have a website that you'd like to monitor but would rather not pay outrageous fees to some company? This simple script will monitor uptime for you website. It is the barebones version and can be easily modified into something highly useful. - Date added: Wed. March 24, 2004
· Column View Output
· Auto Event Emailer
· IP checker
· Count Down
|
|