best practice registration form / juser / php / onBeforeProcess

Hello,

I am facing a small problem concerning my registration form.

Currently I am using "JUSER" and "PHP onBeforeProcess"...just an example:

Code:
// insert
$db = JFactory::getDbo();
$query = $db->getQuery(true);

$columns = array( 'edit', 'edit_author', 'edit_datetime', 'edit_ip', 'publish', 'publish_author', 'publish_datetime', 'publish_ip');
$values = array();
// proper escaping/quotes should be done here, and probably in a loop, but cluttered the answer, so omitted it
$values[] = "' 1,'".$uk_id."', '".$datetime."', '{xfabrik_user___edit_ip}', 1,'".$uk_id."', '".$datetime."', '{xfabrik_user___publish_ip}'";

$query->insert($db->quoteName('xfabrik_user'));
$query->columns($columns);
$query->values($values);
$db->setQuery($query);
$db->query();

// exit form
return false;

this will work fine, but fields like {xfabrik_user___publish_ip} or {xfabrik_user___password} will only work correct, when I don't use "return false;". When I delete "return false;" in PHP, password is being encrypted MD5 and IP is stored, but...some fields like "databasejoin" return NULL.

I am looking for best practice to transfer input of fields to database. I hope my question is not confusing. Right now I believe I shouldn't use "return false;" in PHP, but how can I trigger input of fields without loosing those values?

Thank you ;)
 
Should I just update the form in PHP before it is being transfered? For example...Like:

$formModel->updateFormData('sc_user___name', '{sc_user___first_name} {sc_user___last_name}', true);
 
I'm not sure what you are trying to do.
Why are you using a PHP plugin?
Is this on a user registration form? On a edit profile form? Some other form?
 
Simply a registration form with Joomla...yes...I need some custom fields like databasejoin, IP, YesNo, fileupload...I am using JUSER Plugin to sync corresponding fields with Joomla user table. I might also sync with coorejoomla forum (user). I am using PHP onBeforeProcess in order to manipulate some fields. For example:

first_name (visible) + last_name (visible) = name (hidden)
 
As I mentioned, a databasejoin field returns NULL in database, when I go with no PHP onBeforeProcess...it's an integer PK that should be in database on this specific field...currently trying to solve this
 
stupid me...I wasn't paying attention...I sbmitted the form without choosing some value from the drop down for databasejoin. I need more sleep :) Sorry...solved
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top