Page 1 of 2

Redirecting user after login.

Posted: Sat Mar 08, 2003 3:31 pm
by 11Bravo
Im wanting to redirect user once they login into the forums to like their profile or back to the main site. Where in the code can change it to redirect somewhere else?

Posted: Sat Mar 08, 2003 4:33 pm
by A_Jelly_Doughnut
In login.php, change the redirect() function.

Posted: Sat Mar 08, 2003 6:40 pm
by 11Bravo
I dont see a redirect() function all I see is this

$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
$redirect = str_replace("?", "&", $redirect);

is that it?

Posted: Mon Mar 10, 2003 12:13 am
by 11Bravo
Ok I need some more help. I cant find out where that functions is. All im looking for is after I login in I get redirected back to the main page, not the forums.

Posted: Mon Mar 10, 2003 12:27 am
by 11Bravo
AHAHAHAHAHAHAHHAH WOWOOHOOO I figured it out. Yea in the face!!!!

Posted: Fri Mar 28, 2003 10:17 pm
by khisanthax
what did you change I'm interested in this too

Posted: Fri Mar 28, 2003 11:54 pm
by 11Bravo
Find these in your login.php

redirect(append_sid("index.$phpEx", true));

And just change the index to where ever you want it to go.

Posted: Sat Mar 29, 2003 3:45 am
by khisanthax
thanks a lot

Posted: Sat Mar 29, 2003 3:53 am
by khisanthax
odd, it only seems to work when I log out, not log in . . .

change what you link to

Posted: Sat Mar 29, 2003 6:28 am
by JSLover
11Bravo wrote: Im wanting to redirect user once they login into the forums to like their profile or back to the main site. Where in the code can change it to redirect somewhere else?

...the easiest fix would be just change what you link to...change... ...to... ...to redirect to the main site...or... ...to redirect to their profile. Where are you linking from?
khisanthax wrote: odd, it only seems to work when I log out, not log in . . .

...that's because there's at least 2 occurrences of that line...change both or leave them alone & do what's in this post.

Posted: Sat Mar 29, 2003 2:34 pm
by khisanthax
there were 3 occurences, and I changed all three of them, but how do I make the changes in your post?

where are you linking from?

Posted: Sun Mar 30, 2003 1:13 am
by JSLover
khisanthax wrote: but how do I make the changes in your post?

If you made the above change it might not matter but...
JSLover wrote: Where are you linking from?

See if you're linking from the home page & you want it to come back to the home page..then open your home page...

Find...(or something close to...it's the link you click on to login)...
  • <a href=/phpbb/login.php>
Replace With...(if your link is really different from this just change the value of href & leave the rest of the tag alone)...
  • <a href=/phpbb/login.php?redirect=/>
...that takes you to your home page...well the root web dir anyway...or...
  • <a href=/phpbb/login.php?redirect=profile.php?mode=editprofile>
...or...
  • <a href=/phpbb/login.php?redirect=profile.php%26mode=editprofile>
...both take you to the profile but one might not work.

Posted: Sun Mar 30, 2003 1:45 am
by khisanthax
okay, so in login.php I'm looking for login.php?redirect=/ and replacing it where I want it to go?

Posted: Sun Mar 30, 2003 1:46 am
by khisanthax
this is the closest that I have:

login.$phpEx?redirect=$redirect&sid=

is that the same?

No

Posted: Sun Mar 30, 2003 2:06 am
by JSLover
No...before I continue answer this...Where are you linking from? Also I said...
JSLover wrote: then open your home page...

...that is IF you ARE linking from your home page then open your home page & make the edit...if you're NOT linking from your home page...tell me that & tell me where you are linking from. Before I respond I wanna see an answer to...
  • Where are you linking from?
...sorry but I've asked 2 times before & 3 times in this is post alone.