Jump to content

Take Away Form?


kirbyweb
 Share

Recommended Posts

It depends on how your login form is set up, but one option would be to redirect to a different page, or refresh the same page but have code like norNerd shows that checks whether or not to show the form, or you can also use Javascript to just remove the entire form element from the DOM structure. If you did that you would need the login form to be using ajax to send the login request and get the response, and if the response indicated a successful login then you could remove the form element.

Link to comment
Share on other sites

You redirect by sending a location header like I showed you in the other thread. The code he posted here just shows an if statement that checks for a cookie. If you're keeping track of the logged in user in the session, then you would use an if statement to check the session to see if the user is logged in, and only show the form if they are not logged in. So you would wrap your HTML form inside an if statement that checks if they're logged in before showing the form.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...