News:

Wondering if this will always be free?  See why free is better.

Main Menu

Redirect Login page to WebSite Home Page

Started by funguy123us, June 27, 2010, 11:10:40 PM

Previous topic - Next topic

funguy123us

Hi,

I am using ssi_login(); in home page (mysite.com/index.php) of my site. When I login it takes me to my forums (mysite.com/forums/index.php) page. Is there anyway to make sure it keeps the user on home page (mysite.com/index.php) after they login?

I guess what I need is when user login they should be on same page don't go to forums page.

I know about this mod http://custom.simplemachines.org/mods/index.php?mod=1443 but it looks like it will do this for all logins (even the logins that are made from forums page (mysite.com/forums/index.php). I only want to do this for the ssi_loing() on my home page.

Thanks in advanced

JBlaze

Jason Clemons
Former Team Member 2009 - 2012

funguy123us

Quote from: JBlaze on June 27, 2010, 11:12:11 PM
ssi_login('http://www.mysite.com/index.php' [nofollow]);

Thanks JBlaze. that was fast reply.

That works but it is changing it for all logins (even the one that were made from forums page). Is there anyway to just change this for the website's home page?

JBlaze

It shouldn't be changing it for the forum login, just wherever you call ssi_login();
Jason Clemons
Former Team Member 2009 - 2012

funguy123us

Quote from: JBlaze on June 27, 2010, 11:31:30 PM
It shouldn't be changing it for the forum login, just wherever you call ssi_login();

You are correct, I spoke too soon. But here is interesting thing.

If i go to home page -> login -> stay one home page -> go to Forums page -> read posts -> logout (from forums posts) -> It takes back to Home page.

So once you use the ssi_login(mysite.com..) it will always takes back to home page. But if you close the browser and then go to froums page and login from there it's good.

It almost sounds like it keeps the settings for ssi_login during the session of the browser and it will keep that setting until you close the browser. Not a big deal but it would be nice if it was hard rule on when it should go back to my home page.

JBlaze

Then use this:
ssi_login($_SERVER['PHP_SELF']);

That will redirect back to whatever page you are on.
Jason Clemons
Former Team Member 2009 - 2012

funguy123us

Quote from: JBlaze on June 27, 2010, 11:53:07 PM
Then use this:
ssi_login($_SERVER['PHP_SELF']);

That will redirect back to whatever page you are on.
sweet, that worked. Although i had to add 'http://' for the url name.

The interesting thing is that when i use the same for logout, it just keeps that setting. So it always goes back to WebSite home page (not the forums page). I don't care for logout as much but I would think they both works the same way?

Deaks

 funguy123us, do you still have this issue?
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: