Redirecting user after login.

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
User avatar
11Bravo
Registered User
Posts: 64
Joined: Tue Feb 11, 2003 3:06 pm
Location: Center of my mind
Contact:

Redirecting user after login.

Post 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?
That which does not kill us makes us stronger
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Post by A_Jelly_Doughnut »

In login.php, change the redirect() function.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
11Bravo
Registered User
Posts: 64
Joined: Tue Feb 11, 2003 3:06 pm
Location: Center of my mind
Contact:

Post 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?
That which does not kill us makes us stronger
User avatar
11Bravo
Registered User
Posts: 64
Joined: Tue Feb 11, 2003 3:06 pm
Location: Center of my mind
Contact:

Post 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.
That which does not kill us makes us stronger
User avatar
11Bravo
Registered User
Posts: 64
Joined: Tue Feb 11, 2003 3:06 pm
Location: Center of my mind
Contact:

Post by 11Bravo »

AHAHAHAHAHAHAHHAH WOWOOHOOO I figured it out. Yea in the face!!!!
That which does not kill us makes us stronger
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

what did you change I'm interested in this too
User avatar
11Bravo
Registered User
Posts: 64
Joined: Tue Feb 11, 2003 3:06 pm
Location: Center of my mind
Contact:

Post 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.
That which does not kill us makes us stronger
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

thanks a lot
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

odd, it only seems to work when I log out, not log in . . .
JSLover
Registered User
Posts: 221
Joined: Tue Nov 05, 2002 11:11 am
Location: Bridge USS Enterprise-E Movies-to-go-see: Phone Booth & What a Girl Wants

change what you link to

Post 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.
Image
Avril Lavigne On Tour Now! Tonight (Mon Apr 21): Winnipeg, MB
Next: Calgary, AB on Wed Apr 23
What a Girl Wants - NOW PLAYING - Click Here For Tickets & Showtimes
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

there were 3 occurences, and I changed all three of them, but how do I make the changes in your post?
JSLover
Registered User
Posts: 221
Joined: Tue Nov 05, 2002 11:11 am
Location: Bridge USS Enterprise-E Movies-to-go-see: Phone Booth & What a Girl Wants

where are you linking from?

Post 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.
Image
Avril Lavigne On Tour Now! Tonight (Mon Apr 21): Winnipeg, MB
Next: Calgary, AB on Wed Apr 23
What a Girl Wants - NOW PLAYING - Click Here For Tickets & Showtimes
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

okay, so in login.php I'm looking for login.php?redirect=/ and replacing it where I want it to go?
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

this is the closest that I have:

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

is that the same?
JSLover
Registered User
Posts: 221
Joined: Tue Nov 05, 2002 11:11 am
Location: Bridge USS Enterprise-E Movies-to-go-see: Phone Booth &amp; What a Girl Wants

No

Post 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.
Image
Avril Lavigne On Tour Now! Tonight (Mon Apr 21): Winnipeg, MB
Next: Calgary, AB on Wed Apr 23
What a Girl Wants - NOW PLAYING - Click Here For Tickets & Showtimes
Locked

Return to “2.0.x Support Forum”