Redirect after login

Forum
Last Post
Threads / Messages

Empress_Swanbottom

Member
Member
Joined
Feb 6, 2013
Messages
48
Points
0
Age
26
Mysidian Dollar
4,241
I was wonder if there was a way to make it so that after someone logs in, the page will redirect to the home page after say... a five second wait. I found things for redirect with wait, but they all say that you can't have anything in the PHP file or else it won't work. Can anybody help me?
 
Last edited:
umm what error messages do you get after redirecting users? Id like to see what I can do to help you with this issue.
 
I edited login.php right after this comment: // Validation succeeded, now begins the actual login procedure

to include this html code:
HTML:
<head>
<meta http-equiv='refresh' content='5; URL=http://touhouables.elementfx.com/index.php'>
</head>

so my new php code is this:

PHP:
// Validation succeeded, now begins the actual login procedure
		 
		 $mysidia->page->settitle($lang->success_title);
		 $mysidia->page->addcontent("<head>
                         <meta http-equiv='refresh' content='5;
                          URL=http://touhouables.elementfx.com/index.php'>
                          </head>
                          Welcome back {$mysidia->input->post("username")}. {$lang->success}");
		 
		 $mysidia->user->login($mysidia->input->post("username"));

Change "URL=http://touhouables.elementfx.com/index.php" to your site, and "content='5;" to how long you want it to wait in seconds.

Edit: I'm sure this will also work for the log off page, but haven't tried yet. I'll try right now though I'm sure it will work.

Edit2: For logout.php, I edited:

PHP:
  $mysidia->page->addcontent($lang->default);

to

PHP:
  $mysidia->page->addcontent("<head>
			<meta http-equiv='refresh' content='5; URL=http://touhouables.elementfx.com/index.php'>
			</head>". $lang->default);

and it worked.
 
Last edited:
Anytime :smile: Now to keep trying to figure out how to get the profile picture to show up XD
 
I'm a little confused where exactly in login.php I add the code to or what bit is changing? I'm wanting the logged in user to be redirected to their profile page.
 
ohhh I see what you're saying. These are all old posts and the new Mys 1.3.4 is different. I'm having issues with it myself.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top