NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: PaulMacFarlane on March 28, 2024, 12:07:26 AM

Title: Login Page - One page on success, a different one on fail
Post by: PaulMacFarlane on March 28, 2024, 12:07:26 AM
Using the default login page example I'm trying to go to one page if the login is successful and a different page on failure.

Reading through different posts I saw examples of:
    loc:formaction = 'SuccessPage'
    loc:formactiontarget = '_top'

and
        p_web.SetValue('_parentPage','SuccessPage')

neither seem to work.

Using the example code I can 'Authenticate' fine but can't seem to 'act' on it....

  if p_web.GetValue('loc:hash') = p_web.GetSessionValue('loc:hash')
    ! login checking goes here
    if p_web.Authenticate(Loc:Name,Loc:Passw) = true ! WebHandler, Authenticate method needs to be fleshed out.
      p_web.ValidateLogin()                   ! this sets the session to "logged in"
      p_web.SetSessionValue('loc:hash',0)         ! clear the hash, so this login can't get "replayed".

        p_web.SetValue('_parentPage','SuccessPage')

else

        p_web.SetValue('_parentPage','FailedPage')
end
end

I think I'm completely off base !

Title: Re: Login Page - One page on success, a different one on fail
Post by: Alberto on March 28, 2024, 07:26:28 AM
Hi, try using...

p_web.Script( p_web.WindowOpen( 'YourPage') )

regards
Title: Re: Login Page - One page on success, a different one on fail
Post by: PaulMacFarlane on March 28, 2024, 09:30:00 AM
Thank you !  That works.