6 Replies Latest reply on May 10, 2009 7:04 AM by Pharhaan

    After successful login authentication, user record should come on next page

    Pharhaan

      Hi,

       

      I have created three pages

       

      1- Login page

      2- Detail Page

      3- Error Page

       

      After succesful login, i want the profile page (detail page) of the logged in user to be displayed where i have kept all the neccessary fields of the logged in user, but i am getting a blank page means no record is being displayed on the profile page. I simply used the user authentication wizard and redirecting the profile page (if login successful) and on error page (if something goes wrong).

       

      Authentication is working fine but when the user is being directed to the profile page...nothing is being displayed though i have even recordset on the profile page. Am i doing something wrong or am i not properly giving the filter parameters here...please support me.

       

      Following is the screenshot of the profilepage.php

      Screenshot.jpg

        • 1. Re: After successful login authentication, user record should come on next
          DwFAQ Level 4

          For your filter of recordset you want session variable == user id not URL parameter unless user id is being sent through url parameter. URL parameter would have to be something like this profilepage.php?UserID=1 to retrieve user id 1's info.

           

          Also setting up the recordset is only half of retrieving and displaying dynamic info. The recordset retrieves the info to display it you have to drag the binding of the recordset from the binding window to the page where you want info displayed.

          • 2. Re: After successful login authentication, user record should come on next
            Pharhaan Level 1

            Actually i am very new to php...so here i am sending you the actual screenshot where you can see the actual recordset + binding to the page and the filter i am using...i am sure i am doing something wrong in filtering the record...but can't figure it out.

             

            Please see the below screenshot for reference

             

            ScreenShot2.jpg

            • 3. Re: After successful login authentication, user record should come on next
              DwFAQ Level 4

              You should use primary key auto-increment int as user_id in your database table setup and filter your recordset so user_id = session variable user_id instead of username.

               

              Go to Dreamweaver menu/Window/Bindings to make sure bindings window is displayed. From bindings window drill down the Session folder to display your session bindings. In your filtered recordset make sure user_id is written how the user id is written in the session binding for user id. Ideally you would have the user id session setup as user_id with lowercase no spaces.

               

              Use the test button on the recordset window to test the recordset. When your recordset is properly setup filtering from user_id through session variable and you test the recordset you will be prompted with a window to enter a 'test' user_id for the test and the user_id number you enter should only show the record for that user_id. When the recordset is properly tested you can place bindings from that recordset onto the page to display the recordset info on the page.

               

              When you upload and test your page online make sure you are logged in with an active session for your user_id in order for the dynamic info from the recordset to display on the page.

              • 4. Re: After successful login authentication, user record should come on next
                Pharhaan Level 1

                Hi,

                 

                I don't know why i cannot see my filtered record...as mentioned by you in the last post, i did everything the same but still cannot see the user record who has logged in. Although when i am testing the recordset query, i am getting the perfect answer/record but when i put those variables on the page from the binding panel, it never shows me anything.

                 

                One more thing, when i am changing the filter to none, the first record is being displayed.

                • 5. Re: After successful login authentication, user record should come on next
                  zzipper7 Level 1

                   

                  A few ideas:

                   

                  1. Your session variable is most likely not “Username” as you show in the pic unless you personally wrote that Session variable yourself.

                  ( Username =Useranme…more likely its something like Username = kt_login_id_user    ...or something like that if YOU did not create the session variable)

                   

                   

                  1. After log in, a successful redirect is easy to achieve, however a common mistake is that you have not added the “restrict access to this page” code, therefore the page that was redirected to, does not have the code needed to store/retrieve the session information.  Ex: session_start()

                   

                  If you have properly identified the session variable name, and you have confirmed that the page you are viewing is in session then you should have no trouble getting what you need for you recordset statement.

                   

                  If all else fails, test your session by putting this on the page you are wanting to see the variables for:

                   

                  session_start() ;

                  var_dump($_SESSION);

                   

                  This will list all of your varible names.

                   

                  Good luck

                   

                  • 6. Re: After successful login authentication, user record should come on next
                    Pharhaan Level 1

                    session_start() ;

                    var_dump($_SESSION);

                    Thanks zipper...i got the right solution ...actually now i got the working session variable to put in...and my page started to work.