I put the code into the main index.php file inside the root folder so it's not supposed to have any checks if the user is logged in or not. What I seek to achieve is this - A user visits my website (there's no need for redirect to login page/check if user is logged in), at the top of the navigation bar I have a sign button that open a small form right by the button to allow a user to enter their details. Once they fill the form it should send them directly to the a new page which is clientarea.php. I hope I explained myself well.
- Code: Select all
<cms:pages masterpage='users/signin.php' limit='1'>
<cms:form class="offset-by-six sign-in" method='post' anchor='0'>
<cms:if k_success >
<cms:process_login />
</cms:if>
<cms:redirect url='clientarea.php' />
<cms:if k_error>
<div class="alert-area">
<div class="alert alert-error">
<cms:each k_error >
<cms:show item /><br>
</cms:each>
</div>
</div>
</cms:if>
<label for="email">Email</label>
<cms:input name='k_user_name' type="text" id="email" />
<label for="password">Password</label>
<cms:input name='k_user_pwd' type="password" id="password" />
<input type="hidden" name="k_cookie_test" value="1" />
<input type="submit" value="Sign In">
<cms:if k_user_registration_template >
or <a href="<cms:link k_user_registration_template />">Sign up</a>
</cms:if>
<cms:if k_user_lost_password_template >
<hr />
<p><a href="<cms:link k_user_lost_password_template />" class="small-red">Forgot password?</a></p>
</cms:if>
</cms:form>
</cms:pages>