Re: Appending current [date] to a database

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 14752
interpreted = N
texte = >Question: I have a pretty simple
here that appends to a database and is >working just fine. However, I just realized that when the data is appended, >the date that is sent is the date the page was loaded, not the date/time the >response is actually generated, so that is kind of screwing up my sort by >date and time setup I have on the results page.I assume the symptom you're trying to avoid is when someone sits there staring at the page for hours, then clicks the submit button. The problem here is that you've stuck the date into the which is sitting on the client's browser. The solution is to use an [Append] context instead, which allows you to set all the field values at the time of submission:Get rid of your $Append in your current form, and then embed [Append] into *discussion.tmpl* (the page that displays after they hit submit).-- discussion.tmpl -- [Append db=responses.db]code=001&date=[date %c]&response=[response]&name=[name]&e-mail=[e-mail][/Append]See how the date doesn't get calculated until after they hit the submit button? All you're doing here is copying all the form variables that you gathered from the previous page, and appending them to the database.Grant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Appending current [date] to a database (Gil Poulsen 1997)
  2. Re: Appending current [date] to a database (Grant Hulbert 1997)
  3. Appending current [date] to a database (Gil Poulsen 1997)
>Question: I have a pretty simple here that appends to a database and is >working just fine. However, I just realized that when the data is appended, >the date that is sent is the date the page was loaded, not the date/time the >response is actually generated, so that is kind of screwing up my sort by >date and time setup I have on the results page.I assume the symptom you're trying to avoid is when someone sits there staring at the page for hours, then clicks the submit button. The problem here is that you've stuck the date into the which is sitting on the client's browser. The solution is to use an [append] context instead, which allows you to set all the field values at the time of submission:Get rid of your $Append in your current form, and then embed [append] into *discussion.tmpl* (the page that displays after they hit submit).-- discussion.tmpl -- [Append db=responses.db]code=001&date=[date %c]&response=[response]&name=[name]&e-mail=[e-mail][/Append]See how the date doesn't get calculated until after they hit the submit button? All you're doing here is copying all the form variables that you gathered from the previous page, and appending them to the database.Grant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Grant Hulbert

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

New WebCatalog Version !!! (1997) [Sum] function? (1997) MacAuthorize and WebMerchant (1997) Database field limit? (1998) Passing Cart variable to subdirectory files? (1997) if then else. BUG? (2003) Re[2]: 2nd WebCatalog2 Feature Request (1996) searching multiple databases in single search (1997) [WebDNA] Dynamic vertical columns (2008) Snake Bites (1997) Pithy questions on webcommerce & siteedit (1997) SetHeader not Working (2006) Multiple Sendmail Tags on One Page (2008) Creating folders and deleting files (1997) Email troubles (2005) Sizes and colors (1999) [GROUPS] followup (1997) List Address Changed! (1998) Can this be done? (1997) Separate SSL Server (1997)