/*
| In case you have input fields on the previous page where
| you can give the user name and password.
*/
//Select database entry with the given username
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$_POST['username']."'");
//Check if the given username exists
$rows = dbrows($result);
if ($rows) {
$cgroup = dbarray($result);
if (md5(md5($_POST['user_password'])) == $cgroup['user_password']) {
//use the explode function to check
$usergroup = explode(".",$cgroup['user_groups']);
//assuming your group ID is 2 (p.s: don't tell me you don't know how to get the group ID)
if (in_array("2", $usergroup)) {
echo "You are in the group";
} else {
echo "You are not in the group";
} else {
echo "wrong password!";
}
} else { echo "No user name such as ".$_POST['username']; }
Quote
Marius L T wrote:
thanks. I added but i see empty window. Can you tell me what ling could be? i'm trying www.rsbot.hostzi.com/perz.php?user_name=(myname)&password=(mypw)
(perz is my php file name)
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".stripinput($_POST['username'])."'");
Quote
afif wrote:
do you have any experience with php mysql or html?
Quote
Marius L T wrote:
How to input script??
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
4 participants
Notifications
You are not receiving notifications from this thread.
Related Questions