Passworded User Groups

Started by jaxpylon, May 25, 2006, 08:51:53 PM

Previous topic - Next topic

jaxpylon

Hi. I've been reading much of the coding stuff in this forum and have fiddled around a bit and I've managed to create a text box accessible to users in their profile. That I want to do is allow the user to go from one group to another depending on the password they enter. Obviously they'd need to know the password to do so.

For example, they go to the text box, type in "puppy" and if that's correct, they move to a different group. If it's incorrect or they're not in the correct user group, nothing happens.

All I need is to figure out the code for checking the contents of the box against a predefined list and where to put the code.

My guess is that the code would be something like this. Is this right? And if so, where do I put it?

if ($context['member']['usr_pwd'] == 'puppy' && $_POST['group'] = 9)
{
     $_POST['group'] = 10;
}

jaxpylon

Can anyone tell me if that code is even right? If I try putting it under the code for the password box then I get no errors but nothing happens. By looking through the profile template I can't find any particular section that appears to run with the user presses submit. Some help please?

kegobeer


if ($context['member']['usr_pwd'] == 'puppy' && $_POST['group'] == 9)
{
     $_POST['group'] = 10;
}


I have no idea if your code will actually do anything.  All I did was correct the last comparison.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

jaxpylon

Ah thanks. I missed that. Unfortunately it still doesn't work. Any idea if it's the code or where it is?

jaxpylon

*bump*
Still haven't gotten any help. Does anyone know if this code is right? If so where should it go?

Advertisement: