I use ChronoForms to store information (from users) in a DB-table and ChronoConnectivity to get data out of this table and to do some calculations with the data. This calculation is directly done after submitting the data from the form into the database (same session).
Of course the user would like to see only his calculation, not the calculation from other DB-records.
I tried to use the uid-field from the DB to retrieve the correct record to do the calculation with.
My approach was in CF getting the uid with:
in On Submit code - before sending email:
and using in CC in the where field:
But that does not work.
Is above the best approach or could I better use cookies for this (and yes, how)
Of course the user would like to see only his calculation, not the calculation from other DB-records.
I tried to use the uid-field from the DB to retrieve the correct record to do the calculation with.
My approach was in CF getting the uid with:
<?php
global $uid
$uid= JRequest::getVar('uid');
?>
in On Submit code - before sending email:
and using in CC in the where field:
where uid = '($uid)'
But that does not work.
Is above the best approach or could I better use cookies for this (and yes, how)
Hi bobmijwaard,
I'm assuming here that 'uid' is the Joomla user ID? Then try this in the Where bob
Bob
I'm assuming here that 'uid' is the Joomla user ID? Then try this in the Where bob
<?php
$user =& JFactory::getUser();
echo "WHERE `uid` = '".$user->id."'";
?>
Bob
The fields:
cf_id
uid
recordtime
ipaddress
are created by CF when creating a table from the CF component.
Your code does not work directly, but you show me a direction. I try and find out. If I do not have any succes, I 'll be back
cf_id
uid
recordtime
ipaddress
are created by CF when creating a table from the CF component.
Your code does not work directly, but you show me a direction. I try and find out. If I do not have any succes, I 'll be back
Hi bobmijwaard,
Yes - that the ChronoForms unique ID for the record (a random string). To link a record to a user you probably need to save the Joomla user id in the table.
Bob
Yes - that the ChronoForms unique ID for the record (a random string). To link a record to a user you probably need to save the Joomla user id in the table.
Bob
I have solved this issue by using the IP address:
Normally this should work.
<?php
$ip=$_SERVER['REMOTE_ADDR'];
echo "WHERE `ipaddress` = '".$ip."'";
?>
Normally this should work.
Hi bobmijwaard,
Should work Ok-ish - the problem with IP addresses is that they can be shared and they can change (my isp changes mine every week or so) so they aren't a true unique id.
Bob
Should work Ok-ish - the problem with IP addresses is that they can be shared and they can change (my isp changes mine every week or so) so they aren't a true unique id.
Bob
I agree, but at this moment it is good enough to identify the user for the very moment.
A selection based on userid should be better, but the user can use the form without registering, so this user does not have an user-id (I guess)
A selection based on userid should be better, but the user can use the form without registering, so this user does not have an user-id (I guess)
This topic is locked and no more replies can be posted.