ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Login form problems

September 09, 2010 6:55am

Subscribe [3]
  • #1 / Sep 09, 2010 6:55am

    roryrabbitfield

    320 posts

    I have this login form:

    <div id="login_form" class="droid font10">
    {exp:member:login_form return="home/index"}
    <label>Username</label>   <input type="text" name="username" value="" maxlength="32" class="input" size="25" /><br >
    
    <label>Password</label>   <input type="password" name="password" value="" maxlength="32" class="input" size="25" /><br >
    
    {if auto_login}
    <input class='checkbox' type='checkbox' name='auto_login' value='1' /> Auto-login on future visits
    
    {/if}
    
    <input type="submit" name="submit" value="Submit" />                 
    <a href="http://{path=member/forgot_password}">Forgot your password?</a>
    
    {/exp:member:login_form}
    </div><!-- end div login_form -->

    As you can see, I have “home/index” specified as the place to go after you submit the form. But, when you click the “submit” button, it takes you to “temp_page/index” instead. I have “temp_page” set as the default template group, but I want the form to take you to “home/index”. Why isn’t this working the way I would expect?

    Next, when submit the form (with correct login info), and then manually go to “home/index”, I would expect to see the page as if “logged_in”. But that doesn’t happen; I see the page as if “logged_out”. This next bit of code has some conditionals that look for whether you are logged in/out:

    {if logged_in}
    Hello, {screen_name}.     <a href="http://{path=logout}">Logout ></a>
    
    
    <a href="#%22class=%22droid" class="droid font14 borderButton">VIEW PICK TRAY</a>
    {/if}
    {if logged_out}
    {!-- <a href="http://{path=member/login}">Login</a> --}
     <a href="#">Login</a>
    {/if}

    ... and the “logged_out” stuff shows, not the “logged_in_ stuff. Why?

    More info: If I submit the form with incorrect login info, it also takes me to “temp_page/index”. Isn’t it supposed to go to somewhere else instead?

    I am using .htaccess to remove “index.php” from my URLs, just FYI, in case this is relevant.

  • #2 / Sep 09, 2010 4:09pm

    Brandon Jones

    5500 posts

    Hi Rory,

    1. Can you confirm the version and build of EE you’re using?
    2. Please temporarily rename your .htaccess file and set ‘index.php’ back as your site’s index page before we go further, and see if there’s any change.

  • #3 / Sep 09, 2010 11:17pm

    roryrabbitfield

    320 posts

    The current version of ExpressionEngine is v2.1.0 Build 20100810

    OK, so I did what you said (disabled .htaccess and put index.php back as my site’s index page) and the problem is fixed. But, how do I get this working with index.php removed, as I would like it to be?

  • #4 / Sep 10, 2010 9:38am

    Ingmar

    29245 posts

    Since this is an issue with mod_rewrite I’ll move this thread to the CSS. Thanks.

  • #5 / Sep 10, 2010 10:24am

    roryrabbitfield

    320 posts

    I don’t know anything about mod_rewrite, is that what .htaccess is?

    Can someone help?

    Thx,
    Rory

  • #6 / Sep 10, 2010 10:29am

    Ingmar

    29245 posts

    Yes, that’s what .htaccess is used for, partly at least. Hopefully somebody with more experience in these issues will chime ine.

  • #7 / Sep 10, 2010 1:33pm

    roryrabbitfield

    320 posts

    FWIW, here is the contents of my .htacess doc:

    # Use PHP5 Single php.ini as default
    AddHandler application/x-httpd-php5s .php
    
    # Remove index.php from URLs using include method
    RewriteEngine on 
    RewriteCond $1 ^(weblog|member|search|Forum_Name|home|includes|jewelry|collection|temp_page|contact|about|where_to_buy|members|one_of_a_kind|printable_catalog|P[0-9]{2,8}) [NC] 
    RewriteRule ^(.*)$ /index.php/$1 [L]
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases