NetTalk Central

Author Topic: Login Page - One page on success, a different one on fail  (Read 2256 times)

PaulMacFarlane

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Login Page - One page on success, a different one on fail
« 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 !


Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Login Page - One page on success, a different one on fail
« Reply #1 on: March 28, 2024, 07:26:28 AM »
Hi, try using...

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

regards
-----------
Regards
Alberto

PaulMacFarlane

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Login Page - One page on success, a different one on fail
« Reply #2 on: March 28, 2024, 09:30:00 AM »
Thank you !  That works.