Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 12:16:15 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155473 Posts in 21708 Topics by 7734 Members
Latest Member: rofroodoOvego
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: * solved * Individual welcome page for registered users after login?  (Read 1645 times)
Chaploo
Guest
« on: December 15, 2008, 11:01:16 AM »

Hi everybody,

I was wondering if it's possible to show individual pages to registered users directly after login depending on the user that has logged in.

So far I use the snippet

<form name="login" id="login" action="<?php echo LOGIN_URL; ?>?redirect=<?php echo WB_URL; ?>/pages/userxyz.php" method="post">

to call a special user page directly after login. But this page is the very same for any user that is logging in. What I want is:

User A > logs in > userpage A is shown
User B > logs in > userpage B is shown
etc.

Does anybody know or have an idea, if this is possible?

Regards
Jochen
« Last Edit: December 15, 2008, 02:07:21 PM by Chaploo » Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2856



WWW
« Reply #1 on: December 15, 2008, 01:12:10 PM »

Use the userid or groupid


userid:
Code:
<form name="login" id="login" action="<?php echo LOGIN_URL?>?redirect=<?php echo WB_URL?>/pages/user<?php echo $wb->get_user_id?>.php" method="post">

groupid:
Code:
<form name="login" id="login" action="<?php echo LOGIN_URL?>?redirect=<?php echo WB_URL?>/pages/user<?php echo $wb->get_group_id?>.php" method="post">

Have fun,
John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Chaploo
Guest
« Reply #2 on: December 15, 2008, 02:06:54 PM »

Great! Thanks a lot!  grin

Regards
Jochen
Logged
chabar2000

Offline Offline

Posts: 152


« Reply #3 on: December 29, 2008, 03:31:05 PM »

Code:
redirect=<?php echo WB_URL?>/pages/user<?php echo $wb->get_user_id?>.php

does not work, but

Code:
redirect=<?php echo WB_URL?>/pages/user<?php echo $_SESSION['USER_ID']; ?>.php

works fine after the second login. After the first login is possible redirect fails, then after logging in again the redirection works perfectly. Any hints?

Second problem:
this works when pasted into the template, but not in CODE-Section on pages! Does somebody know how to do that?

Thank you
Karl
« Last Edit: December 29, 2008, 03:54:28 PM by chabar2000 » Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2856



WWW
« Reply #4 on: December 29, 2008, 04:30:22 PM »

works fine after the second login. After the first login is possible redirect fails, then after logging in again the redirection works perfectly. Any hints?

When logging in the userid is not yet filled, the user needs to be logged in first

Set redirect to a page with code wich redirects to the correct page with use of the userid



On a code section only pure PHP is used
So you need to echo everything and can't use the php tags <?php or ?>

Code:
echo "redirect=".WB_URL."/pages/user".$_SESSION['USER_ID'].".php";

John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
chabar2000

Offline Offline

Posts: 152


« Reply #5 on: December 29, 2008, 04:38:26 PM »

Thank you, will try soon!
Karl
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2856



WWW
« Reply #6 on: December 29, 2008, 04:46:54 PM »

One other option

test if userid is NOT set yet (equel to 0)
if so redirect to login, if userid is set redirect to uesr page


john
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
simmy2000

Offline Offline

Posts: 16


« Reply #7 on: January 24, 2009, 08:41:25 PM »

sorry but i don't understand where have i to put that snippet:

Code:
echo "redirect=".WB_URL."/pages/user".$_SESSION['USER_ID'].".php";

can someone explain me what i need to do??
i really need to have this "thing" on my website....

thanks
« Last Edit: January 24, 2009, 09:03:40 PM by simmy2000 » Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!