Drupal custom login form creation

492 views Asked by At

I have this html structure in my blick.tpl.php ////////////////////////////////////////////////

<?php echo $block->title; if($block->title == 'login') { ? >  < form id="form" name="form" method="post" action="" >
    <input type="hidden" name="remember_option" value="" />

    <div id="field" style="margin-top:20px;">
        <label>Username: </label>
        <input type="text" name="loginname" id="loginname" value=""/>
    </div>
    <div id="field">
        <label>Password: </label>
        <input type="password" name="loginpassword" id="loginpassword" value="" />
    </div>     
    <div class="spacer"></div>
    <div id="field">
        <label></label>
        <input type="checkbox" class="form-checkbox" value="1" style="width:14px; margin:30; padding:0;" id="remember_me" name="remember_me"><span style="font-size:12px;line-height:17px; padding-left:10px;">Remember Me</span>
    </div>  

    <div id="formbuttons">
        <div id="button-green">
            <button type="submit" style="cursor:pointer; margin-left: 40px;">Login</button>
        </div>
    </div>
    <div class="spacer"></div>
    <div class="spacer"></div>

       <div id="field"><span style="font-size:12px;"><center><a href="http://vidwin.com/landing/forgot.php"><u>Forgot your password</u>?</a> | Not a member? <a href="http://vidwin.com/landing/signup.php"><u>Click Here</u></a></span></center></div>
</form>< ?php }? >

and i have a module called login where I have this code

< ?php function login_menu(){ 



$items = array();

$items['login'] = array(
'title'            => t('Login Upload'),
'page callback'    => 'login_block_view',
'access arguments' => array('access content'),
);

$items['login/%'] = array(
'title'            => t('Login Upload'),
'page callback'    => 'login_block_view',
'access arguments' => array('access content'),
);

return $items;} ?>

I have the respective functions related to function login_menu

but my form is not submiting properly and not redirecting me to user/login , please tell me where I m wrong

1

There are 1 answers

0
IshaS On

why don't you use the Drupal form stucture by giving 'page callback' => 'drupal_get_form' ?