This is a discussion on "[SOLVED] PHP Logout Message when redirect" within the PHP Forum section. This forum, and the thread "[SOLVED] PHP Logout Message when redirect are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] PHP Logout Message when redirect
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] PHP Logout Message when redirect
Hi everyone was womdering i have a logout page and when it logs out it redirects to the index.php but when it redirects to index.php i want it to say "Logged out Successfully.
hope some1 can help. Thanks Aadon Last edited by Aaron1988; Nov 18th, 2007 at 21:43. Reason: corrected spelling and grammer |
|
|
|
||||
|
Re: PHP Logout Message when redirect
Okay tell the redirect to go to: /?logout
This is a GET query. So where you want the message to appear put the following code:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: PHP Logout Message when redirect
ok this is my logout page code
Thanks Aaron |
|
||||
|
Re: PHP Logout Message when redirect
And this part:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
cheers mate
but anyway thanks for your help it works also how can i have it so it says you have "logged out successfully" then it shows there $username? Thanks Aaron |
|
||||
|
Re: PHP Logout Message when redirect
Well you destroyed the session in the log out script that held the username so you'd have to go to a lot of bother for that.
It's not really worth it.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
ok mate,
so just keep it as it is then Cheers Aaron |
|
||||
|
Re: PHP Logout Message when redirect
Do you know how to do that?
would be something like this at the top of every page you want protected:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: PHP Logout Message when redirect
Hey mate thanks for that i did already know how to do that lol, cause had one already that used the checklogin function lol,
Only thing i wanted with the restrict access, was when it restircts say a "You have entered a restricted error <a href="/login/register.php" Thanks Aaron |
|
||||
|
Re: [SOLVED] PHP Logout Message when redirect
Ahh right:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Last edited by alexgeek; Nov 19th, 2007 at 15:58. |
|
|||
|
Re: [SOLVED] PHP Logout Message when redirect
mate i know you put this as solved but it not lmao cause when i use the 2nd code you give me i get this error
Fatal error: Call to undefined function: eit() in /home/greatmaste/domains/qwhosting.co.uk/public_html/aboutshop.php on line 5 |
|
||||
|
Re: [SOLVED] PHP Logout Message when redirect
Sorry typo. it's exit()
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: [SOLVED] PHP Logout Message when redirect
ok mate lol, also i dont want the message ti display on a white page lol i want it to be displayed on the index.php page cause then itbe eaiser and will look more professional
Thanks Aaron |
|
||||
|
Re: [SOLVED] PHP Logout Message when redirect
Oh okay.
Do the same as the first example but change it to redirect to /?login then put this wherever you want the text to appear:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
hi i have put this on my page i want protected
|
|
||||
|
Re: [SOLVED] PHP Logout Message when redirect
Yes should be! Glad it works now mate.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: [SOLVED] PHP Logout Message when redirect
it doesnt lol cause when i click the page which is protected it doesnt say the messge "you are not logged in"
Thanks Aaron |
|
||||
|
Re: [SOLVED] PHP Logout Message when redirect
Just glanced over your code. you didn't send the ?login like i said:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
cheers mate you forgot to put the ? next to /login lol so i corrected it and now it works like a charm.
Cheers for your help mate most appreciated. P.S if i need anymore help with my site i will post another thread lol Thanks Aaron |
|
|||
|
Re: [SOLVED] PHP Logout Message when redirect
also it says welcome admin and right next to it it says you are logged it so how can i make it go on to a new line
and also when i login and click the protected page lol it still says "Welcome Admin then the mesage i set which is "you need to login to view content" i have fixed the bit which says welcome admin when i click the protected page it was cause i started the session lol but didnt destroy it but now when i login and click the protected page it still says "you need to login to view content" Cheers Aaron Last edited by Aaron1988; Nov 19th, 2007 at 17:32. Reason: added more content |
![]() |
| Thread Tools | |
|
|