Search the Community
Showing results for tags 'level'.
-
Hi, I have my login system working fine with sessions. Now I want to use access levels. So if user 1 with access level 1 logs in, he redirects to profile.php. If user 2 with access level 2 logs in, he redirects to main_stats.php. Here is what I have so far for my login.php, however it is not reading the $user_id nor the $access_id: http://codepad.viper-7.com/Ck0Tsr Wondering if anyone can help?
-
db table username------>id->username->cash->points->referrer db table referral_levels------>id->level->earnings->signupBonusCash->signupBonusPoints->status username referrer -------- -------- admin kelly88 admin // UPDATE USERNAME ADMIN WITH referral level 1 POINTS/CASH // jacob kelly88 // UPDATE USERNAME ADMIN WITH referral level 2 POINTS/CASH AND USERNAME kelly88 WITH referral level 1 POINTS/CASH // david16 jacob // UPDATE USERNAME ADMIN WITH referral level 3 POINTS/CASH AND USERNAME kelly88 WITH referral level 2 POINTS/CASH AND USERNAME jacob WITH referral level 1 POINTS/CASH // Is this possible. If yes - HOW? Current test registration code with referral level 1 <?php if(!empty($_GET['ref'])){ $referrerUsername = filter_input(INPUT_GET, 'ref', FILTER_SANITIZE_STRING); if(usernameExist($referrerUsername, $db) === TRUE){ $_SESSION['ref'] = $referrerUsername; } } // define variables with the value for each field // the value from POST,GET if this exist, or an empty value $errors = array(); $username = isset($_POST['username']) ? filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING) : ''; $referrer = !empty($_SESSION['ref']) ? $_SESSION['ref'] : (isset($_POST['referrer']) ? filter_input(INPUT_POST, 'referrer', FILTER_SANITIZE_STRING) : ''); if(!empty($_POST['submit'])){ if(empty($username)){ $errors[] = $lang['error']['a_019']; } else if(validUsernameLenght($username) === FALSE){ $errors[] = $lang['error']['a_020']; } else if(validUsernameChars($username) === FALSE){ $errors[] = $lang['error']['a_021']; } else if(usernameExist($username, $db) === TRUE){ $errors[] = $lang['error']['a_022']; } if(!empty($referrer)){ if(usernameExist($referrer, $db) === FALSE){ $errors[] = $lang['error']['a_037']; } else if($username == $referrer){ $errors[] = $lang['error']['a_038']; } } } if(!empty($_POST['submit']) and empty($errors)){ /* $queryOne = 'INSERT INTO users(username, referrer) VALUES (:username, :referrer)'; $insertOne = $db->prepare($queryOne); $insertOne->bindParam(':username', $username, PDO::PARAM_STR); $insertOne->bindParam(':referrer', $referrer, PDO::PARAM_STR); $successOne = $insertOne->execute(); */ if($referrer){ $query = 'SELECT signupBonusCash AS sbc, signupBonusPoints AS sbp FROM referral_levels WHERE level = 1 AND status = "enabled"'; $select = $db->query($query); $row = $select->fetch(PDO::FETCH_ASSOC); $queryTwo = 'UPDATE users SET points = points + :points, cash = cash + :cash WHERE username = :referrer'; $selectTwo = $db->prepare($queryTwo); $selectTwo->bindParam(':cash', $row['sbc'], PDO::PARAM_STR); $selectTwo->bindParam(':points', $row['sbp'], PDO::PARAM_STR); $selectTwo->bindParam(':referrer', $referrer, PDO::PARAM_STR); $selectTwo->execute(); } } if(!empty($errors)){ foreach($errors as $error){ print $error.'<br>'; } } print ' <form method="POST"> <table style="width:100%"> <tr> <td style="width:30%;font-weight:bold">Username</td> <td style="width:70%"><input type="text" name="username" maxlength="255" style="width:200px" value="'.cleanOutput($username).'"></td> </tr>'; if(!empty($_SESSION['ref'])){ print ' <tr> <td style="font-weight:bold">'.$lang['global']['a_047'].'</td> <td><input type="text" name="referrer" readonly="readonly" maxlength="255" style="width:200px" value="'.cleanOutput($referrer).'"></td> </tr>'; }else{ print ' <tr> <td style="font-weight:bold">'.$lang['global']['a_047'].'</td> <td><input type="text" name="referrer" maxlength="255" style="width:200px" value="'.cleanOutput($referrer).'"></td> </tr>'; } print ' <tr> <td colspan="2" style="text-align:center"><input type="submit" name="submit" value="Submit"></td> </tr> </table> </form>'; ?>
-
Hi all,,, i have to hide a column(LOCATION) that may not be seen for user level 3 or below i have like this ID Name Location Sex , , , | | | | | | | | how to do it ,,, any one would like to help me please ??? Thank you ,,,