PHP Button - sc_redir just shows OK

I love SC… but I’m still learning the ins and outs and here is another question… (I do appreciate all the help so far in the forums).

I have a button with PHP code. This is what I hope to accomplish:

1-Check if a global var is set (basically, if [g_userid] is NOT blank)
2-If [g_userid] is NULL, display the login form (modal), allow user to login, then display next form (FORM_REGISTER).
3-If [g_userid] is NOT empty, then continue to the next form (we’ll say FORM_REGISTER).

So far, I have sc_redir(login.php,modal) in the PHP button code, but it only goes to the next screen and displays an OK button. If I take out the MODAL flag, it displays the login form.

Any ideas to help with this??? Basically, the first form they view is a public form, but MUST be logged in to continue to register further. I cannot require them to log in in order to view the initial form.

Thanks,
chris

Re: PHP Button - sc_redir just shows OK

one of reason i bought sc is ACL(acces control List) on module security ,The easiest way to maintain user without any code.

Re: PHP Button - sc_redir just shows OK

Thanks Masbro, but I’m not sure I want to use built in security and my reasoning for trying to do what I want to do isn’t really about security, its more for the user’s information being available to continue the registration process…

Re: PHP Button - sc_redir just shows OK

bump

Re: PHP Button - sc_redir just shows OK

if [g_userid] == NULL {
sc_redir(FORM_REGISTER.php);
} else
{
sc_redir(Login.php);
}

Re: PHP Button - sc_redir just shows OK

thanks leatheric…

Seems there is a bug with the MODAL flag… but your code also helped!

thanks!