5 Replies Latest reply on Nov 11, 2008 3:56 PM by (Steve_U)

    Insert form without Insert button

      Confusing I know.
      Here's what I want to do:

      I authenticate my login from another server.
      Once I successfully login and I'm taken to a page1.php. I want to grab the login (username) which I've carried over and Insert it and other hidden data (an access_level number) into a users table.

      Once the info is submitted on, once the info has been submitted, I'd like the page redirected to another page (page2.php) where I could use the ADDT Restrict Access to page (since this info has already been submitted into my users table).

      So to recap, I go from login.php to script.php (where my login is authenticated) and then redirected to page1.php where I would like to have my login name that has been carried over, and an access level number instantaneously the is submitted into my users table.

      IS this possible using ADDT?
        • 1. Re: Insert form without Insert button
          Level 1
          Peter,

          This is possible, but I'm not sure you can easily use the ADDT tools to create this. It would pretty much be a hand coded page.

          page1.php would need to be coded to:

          1. Grab the username and access_level values carried over from the previous page - I am assuming these are $_SESSION variables

          2. Connect to the database and do a MySQL INSERT on the users table - I don't think you can use ADDT Insert Record transaction here. It would be too complicated to force it to submit.

          3. Redirect user to the page you want using the following php code:
          header('Location: page3.php');
          exit;

          So you just need to get the values, insert to the table, and redirect the user. This page should just be all hand php coded. It should be fairly easy to do this.

          Hope this helps,

          Shane
          • 2. Re: Insert form without Insert button
            Level 1
            Shane,

            Sorry to take so long to respond!
            Thanks for the suggestions..that's exactly what I'm trying to do.

            Question though. Is it possible to use the Tools Restrict Access to Page using this model (logging in using an outside login and grabbing the username and adding an access level yet not having a password)?
            • 3. Re: Insert form without Insert button
              Level 1
              Peter,

              Are you trying to set the correct session variable, without requiring login, to allow the restrict access to page server behavior to work?

              Shane
              • 4. Re: Insert form without Insert button
                Level 1
                Once again sorry for the delay in responding!!!
                I'm definitely setting the correct session variable because I've tested successfully this scenario;
                I submit my login page and echo'd on the code page all 3 session vars (kt_login_id, kt_login_user, kt_login_level) successfully.
                yet, when I comment out the echo, so that when I login I end up on my 3rd page, entry.php, which is Restricted by Access Level, I'm redirected back to the login page.

                Weird, because this was working for a while but now I can't figure it why it won't login.
                • 5. Re: Insert form without Insert button
                  I have the same intermittent problem. Any luck fixing this?