Gossamer Forum
Home : Products : DBMan : Installation :

Add "Last Modified" to Record?

Quote Reply
Add "Last Modified" to Record?
I have a "Last Modified" field on my records and I want to grab the current date and put it in this field whenever someone "Modifies" an existing record.

Anyone know how to accomplish this?
Quote Reply
Re: Add "Last Modified" to Record? In reply to
Hi donm

You can do something like

$today=&get_date;

and then use $today wherever you want...


<INPUT TYPE="TEXT" NAME="Last_Modified" VALUE="$today" SIZE="12" MAXLENGTH="12">

Cheers
-JO
Quote Reply
Re: Add "Last Modified" to Record? In reply to
That works for displaying it in the record you are modiying - however, once I choose "Modify this Record" button - the modified record now has no date at all in it.
Quote Reply
Re: Add "Last Modified" to Record? In reply to
Hi donm

Set up the debug mode on and see what you have for your Last_Modify variable (By the way, the name of the variable needs to be the same as the one defined in your .cfg file).

I guess you would also want to setup this value automaticaly so change it to the following...

<INPUT TYPE=hidden NAME="Last_Modified" VALUE="$today">

Again, Last_Modified needs to be in your db definition in the .cfg file.

Cheers
-JO