J
|
Jane 1/9/2007 |
Ric, function BeforeAdd(&$values) { $values["FieldName"]= "logged ".$values["FieldName"]; return true; }
|
3
|
3dwizard 12/10/2007 |
Hello, Ric, you can do it using events. Proceed to the Events tab. select Before record added event and add your code in it. Here is a sample: where FieldName is your actual field name. |
![]() |
Sergey Kornilov admin 12/10/2007 |
Post your code here. |
3
|
3dwizard 12/10/2007 |
This is the code I am using (basically taken from the previous post)... |
J
|
Jane 12/11/2007 |
Hi, $values["User"]="logged ".$_SESSION["UserID"]; return true; |
3
|
3dwizard 12/11/2007 |
I just actually removed ("logged".) |
T
|
tototoo 12/11/2007 |
That's great! But, how would one display other data from the user table, such as their FirstName and LastName or Company? |
J
|
Jane 12/12/2007 |
Hi, global $conn; $str = "select * from UsersTable where UserName='".$_SESSION["UserID"]."'"; $rs = db_query($str,$conn); $data = db_fetch_array($rs); $values["User"] = $data["FirstName"]." ".$data["LastName"]." ".$data["Company"]; |