Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Using Auth method for login in cakephp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 410
    Comment on it

    First of all load the component in the controller lets say UsersController using the below code



    echo $this->Form->create('User', array('id'=>'signUpForm','name'=>'userSignupForm', 'action'=>'login')); ?>
    <dt>User Name:</dt>
    <dd ><?php echo $this->Form->input('User.username', array('type'=>'text',  'label'=>false, 'div'=>false))?></dd>
    <dd><?php echo $this->Form->input('User.password', array( 'type'=>'password','label'=>false, 'div'=>false)); ?></dd>
    <?php echo $this->Form->end('Login'); ?>

    Write the code in login action of UsersController:


    It will return 0= If logged in failed. Otherwise 1 if successfull.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: