Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Redirect to Previous Page after Login/Logout
This is just a simple modification to rediret a user to the previous page they were viewing after login/logout.
NOTE:Please make a backup of your files before installing this mod! Let's start with login.php 1.Open your login.php and go to line 144 and add this code PHP Code:
If you want to add a timer, instead of using the above code use this instead PHP Code:
Move on to logout.php 2. Now to redirect the logout process. Open your logout.php, on line 80 put this code (same as above) PHP Code:
PHP Code:
You're not limited to this, for example if you wanted to redirect the users to the index page after logging out you can use this code PHP Code:
PHP Code:
Last edited by fadillzzz; 01-25-2011 at 07:28 AM. |
#2
|
|||
|
|||
This seems awesome, but how do I know where to put the code? You said line 144, but I don't know how to tell which is line 144 using the 000webhost editor. :S
|
#3
|
|||
|
|||
Use a PHP editor, you can use notepad++ if you want
|
#4
|
||||
|
||||
Just as a general note, using line numbers as a guide to put the code can be very faulty. If users have added other mods beforehand the lines will be messed up for them. I usually use a chunk of code that comes before or after the place the new code should go.
|
#5
|
|||
|
|||
Ok, I'll keep that in mind for another tutorial
|
#6
|
|||
|
|||
Ah, yeah, I do remember I had Notepad++. I'll use that, thanks. :o
|
#7
|
||||
|
||||
On some hosts, the header redirect will be funky, especially if you have an email system somewhere. For an alternative, you can use the following.
PHP Code:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mys v1.3.4 Seamless Login/Logout Redirect to Index | Kyttias | Mys v1.3.x Mods | 13 | 06-03-2020 10:13 AM |
Redirect after login | Empress_Swanbottom | Questions and Supports | 10 | 06-03-2020 10:12 AM |
Login/Logout Error | tahbikat | Questions and Supports | 15 | 02-15-2014 10:26 AM |
New Users auto redirect to page | mapleblade | Mys v1.2.x Mods | 6 | 02-09-2012 09:47 AM |
Login page..? | Tequila | Questions and Supports | 3 | 05-18-2011 04:39 PM |
What's New? |
What's Hot? |
What's Popular? |