1 Reply Latest reply on Oct 14, 2007 12:27 AM by Günter Schenk

    Dynamic Redirect

      Can you someone help me create a login based on a mysql table that includes username password and url, and the user is redirected based on their username?

      Do I create some kind of recordset base on the username? I tried to do it and the page does not even load. Can I get some kind of theory of this can be achieved using the ADDT? Or maybe even a walk through.
        • 1. Re: Dynamic Redirect
          Günter Schenk Level 4
          Hi,

          I think this should be rather easy :: on the standard "redirect after login" page defined in ADDT´s Control Panel, you´d probably just need to...

          1. add on line 1 to make sure that page will detect the ADDT session variables

          2. add a query which will check the url against the currently logged in user´s "id" -- example:

          "SELECT url FROM user_table WHERE id" equals the session variable "kt_login_id"

          3. immediately after the query, and preceeding the pages "DOCTYPE html PUBLIC etc etc" html stuff, add a standard PHP redirection script, example:



          now the somewhat tricky part will be to add the query´s "url" value to that redirection URL -- means you will have add...

          $row_queryname['url'];

          after e.g. the abovementioned URL´s trailing slash. As this approach is meant to add a dynamic variable inside an otherwise static value that´s already starting/ending with apostrophes (''), you assumingly will have to embed the variable within additional apostrophes as well, like this:



          does this work ?

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver