Jump to content

Take Away Form?


kirbyweb

Recommended Posts

I think this is my last question yay, then I am stopping my project until I can find graphic designers.So anyway, how would I make it so when the user logs in then it takes away the login form?I need a code or a link or something please, a little faster if possible thanks.

Link to comment
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...