if (count($FORM_ERRORS) > 0) unsetPostRequestElement('ok');
}
-if ((isFormSent()) && (count($FORM_ERRORS) == 0)) {
+if ((isFormSent()) && (count($FORM_ERRORS) == '0')) {
// Generate message array
$messageArray = array(
'failed' => getMessage('SPONSOR_REGISTRATION_FAILED'),
// Check the status of the registration process
switch ($STATUS) {
case 'added': // Sponsor successfully added with account status = UNCONFIRMED!
- // Check for his ID number
+ // Check for his id number
$result = SQL_QUERY_ESC("SELECT `id`, `hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `email`='%s' LIMIT 1",
array(postRequestElement('email')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
- // ID found so let's load it for the confirmation email
+ // id found so let's load it for the confirmation email
list($id, $hash) = SQL_FETCHROW($result);
// Prepare data for the email template
$content['refid'] = bigintval(postRequestElement('refid'));
} // END - if
- // Prepare referal things
- if (isGetRequestElementSet('refid')) {
- // Referal ID transmitted, we don't care here if it is right or not
- $content['refid'] = bigintval(getRequestElement('refid'));
- } else {
- // No referal link
- $content['refid'] = 0;
- }
+ // Prepare referal id
+ $content['refid'] = determineReferalId();
// Display registration form
loadTemplate('guest_sponsor_reg', false, $content);