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
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

forgive me, but I don't know how to answer that question. let me explain, maybe the answer will be there . . . from my site, after users hit submit upon filling out the login information, I want them to go to root/usercp.php. does that answer your question? sorry that I missed it, if it doesn't answer your question can you rephrase it?
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

ok

Post by JSLover »

khisanthax wrote: forgive me, but I don't know how to answer that question. let me explain,

That's ok as long as you acknowledge you saw the question & answer it as you can that helps...& now you have.
khisanthax wrote: maybe the answer will be there . . . from my site, after users hit submit upon filling out the login information,

The answer is between there, a) "from my site,"...what page is site? b) "after users hit submit upon filling out the login information,"...what page were they on to click the link to get to the login form to hit submit? Oh...I think I just got it...you're using the login form on the bottom of the page instead of the separate page with the login form? In this case I need to know what page the form is on...as in what page is site. Also do you a) want them to goto usercp.php no matter how they login or b) want them to only goto usercp.php if they login via the form at the bottom of the page? If neither add your own c) & tell me the details of c)
khisanthax wrote: I want them to go to root/usercp.php.

Doesn't the 3 edits you made to login.php already do this?

Lemme do an example...
I'm visiting example.com which is a normal home page (their installation of phpbb is under the phpbb dir)
To this normal home page the webmaster wants people to be able to login from the home page directly so they added a Login button linked it to /phpbb/login.php
I click on Login it takes me to example.com/phpbb/login.php
I login it takes me to example.com/phpbb
But the webmaster wants it to go back to the home page (or anywhere else)
So the webmaster needs to edit the link on the home page & re-point it to /phpbb/login.php?redirect=/ (or /phpbb/login.php?redirect=/anywhere/else)
...are you like this webmaster?
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 »

yes I'm like the webmaster, let me explain.

From index php, that's the beginning of the site for now, there's the login at the bottom of index.php and I also have the side bar quick register and login box on index.php, but also would like to use the separate login.php page to redirect to usercp.php as well. Using these two I would like to go to usercp.php, all of my scripts are in /Forums/. Only when they login succesffuly though. When I changed all three instance of the above mentioned code, only when I logged out did it take me to the usercp.php and then it's pointless becausey ou have to be logged in to do it.
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

phpbb's index.php?

Post by JSLover »

khisanthax wrote: From index php

...a) is this index.php phpbb's or a custom index.php? b) is this index.php located at http://domain.com/index.php taking you to http://domain.com/Forums/login.php or is it located at http://domain.com/Formus/index.php taking you to http://domain.com/Formus/login.php? Can I have link to your site? I'm really close to a solution, really, but I need to know if this index.php is phpbb's or if it's a custom or portal one. If you don't know just give me a link you your site & then next answer will be the solution.
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 »

I'm so sorry for the late reply, really I am. I'll PM you the link cause I think off site linking is not allowed, but it's the index.php from phpbb, not my own
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

like this

Post by JSLover »

khisanthax wrote: I'll PM you the link cause I think off site linking is not allowed

Off site linking is fine...a) to your own website...you can even put it in your profile & it'll make a Image button...so linking to your site is fine. b) linking to a site that you need support on is also fine. Not needing support & spamming your url (in any place but the Show Off forum) is not fine...but you're not doing this. You fit both a & b so you're really fine. For consistency I'm going to use the subSilver template & then show you how to in your template...

For subSilver...

Backup...
templates/subSilver/index_body.tpl

Open...
templates/subSilver/index_body.tpl

Find...
  • <input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
Replace With...
  • <input type="hidden" name="redirect" value="TO WHERE">
    <input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
Close templates/subSilver/index_body.tpl

For your template...

Backup...
templates/phpXP2/index_body.tpl

Open...
templates/phpXP2/index_body.tpl

Find...
  • <b>Auto Login?</b> <input class="text" type="checkbox" name="autologin" value="ON">
    <input type="submit" name="login" value="{L_LOGIN}"> <br>
Replace With...
  • <b>Auto Login?</b> <input class="text" type="checkbox" name="autologin" value="ON">
    <input type="hidden" name="redirect" value="TO WHERE">
    <input type="submit" name="login" value="{L_LOGIN}"> <br>
Close templates/phpXP2/index_body.tpl

For either template...

Backup...
login.php

Open...
login.php

Find...
  • else
    {
    $forward_page = '';
    }
Replace With...
  • else
    {
    $forward_page = 'TO WHERE';
    }
Close login.php

TO WHERE should be replaced with where you want it to go...
  • /
    • go to home page (possibly outside phpbb {depending on installation})
    /phpbb
    • goto root phpbb page (I think that's what it already does? phpbb should be the folder name you use...phpbb, forum, forums, whatever)
    profile.php?mode=editprofile
    • go to users profile
khisanthax wrote: I want them to go to root/usercp.php.

Assuming root means root phpbb dir...you would use...
  • usercp.php
    • go to user control panel
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 »

thank you! I'll try it and let you know how it goes =)
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

how is the login.php change different from the changes made in index body tpl?
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

nevermind, I got it, thanks for all your help!
Locked

Return to “2.0.x Support Forum”