Welcome Guest, Not a member yet? Register   Sign In
Logout button want it to go to the homepage
#1

[eluser]Samuurai[/eluser]
Hi,

I'm using jGrowl to notify users of actions etc, so when a user logs out I just want it to go to the homepage and jGrowl will pop up a message saying "successfully logged out".

However, I'm not sure how I can set up my logout button.
Currently it's set up like this:
Code:
<form method="post" action="home/homepage" id="logout_form"/>
<input type="hidden" value="logout" name="logout"/>
<a JSonclick="document.logout_form.submit();" href="#">Log out</a>
&lt;/form&gt;
Please note, I typed JSonclick for to get around the security on this forum.


The homepage function then does a sess_destroy if the "logout" post var is set.

It works, but the first time I click the Log out link, it doesn't work, but it does, the second time!

Anyone know a better way to do this?

Thank you!
#2

[eluser]Samuurai[/eluser]
Found the answer in post #6 in this thread: http://ellislab.com/forums/viewthread/127964/




Theme © iAndrew 2016 - Forum software by © MyBB