8 Replies Latest reply on Jun 9, 2007 4:40 PM by (Bert)

    Login User with Dynamic Redirect

      Trying to set up a login form that will redirect each user to their own specific page from an MySQL database.

      I found Login User with Dynamic Redirect extension but it doesnt support php

      Can you please help, I have been searching everywhere

      Thanks
        • 1. Re: Login User with Dynamic Redirect
          Günter Schenk Level 4
          that should be rather easy with ADDT: <br /> <br />1. add another varchar field to your user_table to store the user´s "own specific page" URL, say "my_page" <br /> <br />2. on the page that´s been defined as "default redirect on success" (say, success.php) in ADDT´s "Login Settings", define a query like e.g. "SELECT my_page FROM user_table WHERE user_id" equals the kt_login_id session variable. <br /> <br />3. in case the session isn´t detected <i>(it usually isn´t except for ADDT´s lists)</i>, add... <br /> <br /><?php<br />session_start();<br />?> <br /> <br />on top of "success.php" <br /> <br />4. now simply make sure that your PHP redirection will contain the recordset value, like this: <br /> <br /><?php<br />header('Location: '.$row_queryname['my_page'].'') ;<br />?> <br /> <br />Never tried this myself, but to my understanding this should work -- if not, I´ll eat my hat, promised ;-) <br /> <br />Günter Schenk <br />Adobe Community Expert, Dreamweaver
          • 2. Re: Login User with Dynamic Redirect
            Level 1
            Hi, not sure if this will work because when I say each user to their specific page I didnt mean a page I mean their record id, imagine the user makes a booking, then comes back to check the progress of the booking, so user logs in and goes to customer welcome page then he should see the details of his booking.

            Just like go to detail page behaviour and user login.

            Hope makes sense

            Thanks
            • 3. Re: Login User with Dynamic Redirect
              Günter Schenk Level 4
              I would use a similar approach on your "bookings" page -- based on a query like:

              SELECT field_a, field_b FROM bookings_table WHERE booking_userid" equals the kt_login_id session variable.

              this should work when your "bookings_table" stores the respective user_id of the one who placed a booking

              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Login User with Dynamic Redirect
                Level 1
                Here is the problem with this approach, there are two login tables one for admin one for customers, because admin login is for admin area and only for few users, customer login is with each booking, thats why I couldnt use the kt_login if I understand correctly you can only have one set of login settings with developer tools so I used built in login user behaviour for the customers.

                Couldnt I just pass the session id or url id from login page to customer details page? If this is possible could you show me the code and where to insert it please?

                Thanks

                Bert
                • 5. Re: Login User with Dynamic Redirect
                  Günter Schenk Level 4
                  that´s what ADDT´s user "levels" are meant for -- you could have used just one login table and assign...

                  - admins : level 1
                  - customers : level 2

                  in here

                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Login User with Dynamic Redirect
                    Level 1
                    Hi, ok I took your advice and made some changes.

                    You said "SELECT field_a, field_b FROM bookings_table WHERE booking_userid" equals the kt_login_id session variable. "

                    Where do I find this session variable kt_login_id value

                    I did a search in the actual code there is no kt_login_id anywhere, can you give me a clue for what to look for?

                    Thanks
                    • 7. Re: Login User with Dynamic Redirect
                      Günter Schenk Level 4
                      hmm -- seems you didn´t make use of ADDT´s "login settings", but rather use DW´s native one, right ? if so, ADDT´s session variable "kt_login_id" doesn´t exist, means you need to try with the one that´s assigned by DW´s login stuff.

                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Login User with Dynamic Redirect
                        Level 1
                        Yes actually I used ADDT login form wizard after you suggested. I used user name as email, password

                        So I have the login page and the customer details page after login. I need to jump to that customers details after login

                        on the customer details page recordset I tried job_id = kt_login_user but doesn't work

                        can you please describe what to change and where exactly.

                        I have been looking for this for days now but no luck.

                        Many thanks