Results 1 to 4 of 4

Thread: Login Page without the login

  1. #1
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Login Page without the login

    Hi,

    I have some pages that need to be hidden until the user has agreed the T&C's.

    The way I thought I'd go about it was to protect the pages so they are hidden.
    I've setup a guest member account.
    I then tried creating a custom-html form that would contain hidden fields like so
    (Field ID's etc taken from the login module output)
    Code:
    <form id="tl_login" method="POST" action="some protected page">
    <input type="hidden" value="tl_login" name="FORM_SUBMIT" />
    <input type="hidden" value="guestlogin" name="username" id="username" />
    <input type="hidden" value="guestlogin" name="password" id="password" />
    <input type="hidden" value="1" name="autologin" id="autologin" />
    <input type="submit" value="I agree to the Terms & Conditions" />
    </form>
    but when submitting the form, I get an error page saying 'Forbidden'.
    Anyone know how I can make this a valid login form? I don't want the user to have to type anything, only click the agree button.

    Thanks

  2. #2
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Login Page without the login

    Hi vinchenzison-

    I think the reason your are getting "forbidden" is because your form action is posting to the protected page (the forbidden one).

    If you created a form in the form generator using the same fields below, just set its redirect page to the protected one. The form will post to itself, validate, and THEN redirect to the hidden page.

    Just make sure to set your form ID to tl_login to trigger the login module and I think that should work...

  3. #3
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Login Page without the login

    Hi,

    I've just tried that but doesn't want to work.
    Could it be because the ID's aren't/can't be set for the input fields in the form generator or have I missed something?
    http://www.dngim.com/dev/index.php/entrance-page.html

    Thanks

    James

  4. #4
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Login Page without the login

    ok, sort of found a solution.

    I've created my custom form as above but also added a login module as another cp.
    I've then hidden the login module with css .mod_login {display:none;}
    Submitting my custom form now logs in the user.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •