What is the format of the user id? Is it a number? If so, you could use the ColdFusion Hashids CFC to salt+generate a unique ID to use in a URL:
You could then attempt to parse the hashIds back into a number and, if possible, allow them to edit the associated record that matches the ID.
Another option would be to generate a random hash and store it in database w/information regarding the update form and user id. After the link is clicked, log the date so that the link is disabled and can't be used again.
The return page should use SSL and potentially require them to log in (depending upon the sensitivity of the data that will be updated.)
What is the best way to retrieve information after user click on the link? First step will be to decrypt the ID(yes it is a number) and then pull the information with cfquery or ? I'm trying to think what is the best and most efficient way of doing this. Thank you for help.
I'm not sure I understand your question. What do you mean by the "best and most efficient way"? What are you specifically requesting assistance on? (Your question is somewhat vague.)
- How to perform a SQL SELECT query using ColdFusion?
- How to create an HTML-based form and pre-populate it with query data?
- How to post data from a form back to the server?
- How to perform a SQL UPDATE query using ColdFusion?
I already have a form where user enter all information and after they click submit they receive the link. If they click on the link I want to use the same form and populate all fields with user info.
Are you saving all of the initially submitted fields to a database? If so, perform a query and then output the query values to the form field. I don't know what your data (or database) looks like, but a simplified version could look something like this.
<CFQUERY NAME="GetForm" DATASOURCE="MyDB">SELECT FirstName
WHERE ID = <cfqueryparam value="#URL.ID#" cfsqltype="CF_SQL_INTEGER"></CFQUERY>
<input type="text" name="FirstName" value="#HTMLEditFormat(FirstName)#">