php - Problem with login button value -
Hello, I have just started a codeigniter a few days ago, I have the following problem. When I define the value of the login button (no value) to styling with CSS, the login form will not work, the value must be logged, this is a way, I'm sure there is a way to get it From there .. Here are some code ..
Controller:
& lt ;? Php class extends the login controller {// var $ success = ''; Function Login () {Origin: Controller (); } Function index () {$ success_tmp = '0'; $ This- & gt; Load-> Model ('member'); $ This- & gt; Load-> Assistant (array ('form', 'url')); $ This- & gt; Load-> Library (array ('encrypt', 'form_validation', 'session')); $ This- & gt; Form_validation- & gt; Set_rules ('member_username', 'user', 'required'); $ This- & gt; Form_validation- & gt; Set_rules ('member_pass', 'password', 'required'); $ This- & gt; Form_validation- & gt; Set_error_delimiters ('& lt; them & gt;', '& lt; / them & gt;'); If ($ this-> Input-> Post ('Login')) {If ($ this-> form_validation-> Run ()) {if (& gt; Member- & Gt; check_login () == 1) {// $ this- & gt; Session-> Set_user data (''); Redirect ('index_main'); $ Success_tmp = 1; }}} If ($ success_tmp! = 1) {$ this-> Load-> View ('header'); $ This- & gt; Load-> View ('login_form'); $ This- & gt; Load-> Scene ('footer'); }} Function logout () {$ this-> Load-> Library ('session'); $ This- & gt; Load-> Helper (array ('url')); $ This- & gt; Session-> Sess_destroy (); Redirect ('login / index /'); }}
This is my visual file:
& lt; Div id = "page-top" & gt; & Lt; H1 & gt; Existing ones & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "login_center" & gt; & Lt; Div class = "login_logo" & gt; & Lt; / Div & gt; & Lt ;? $ Attributes = array ('class' = & gt; 'login_form', 'id' = & gt; 'login_form') ;? & Gt; & Lt ;? $ Login_dugme = array ('class' = & gt; 'login_button', 'name' = & gt; 'login', 'value' = & gt; 'login') ;? & Gt; & Lt ;? = Form_open ('login / index /', $ attributes) ;? & Gt; & Lt; Ul class = "login_form" & gt; & Lt; Li & gt; & Lt ;? = Form_label ('username', 'member_namename')? & Gt; & Lt ;? = Form_input ('member_username', set_value ('member_username'))? & Gt; & Lt ;? = Form_error ('member_username') & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt ;? = Form_label ('password', 'member_pass')? & Gt; & Lt ;? = Form_password ('member_pass') & gt; & Lt ;? = Form_error ('member_pass') & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Div class = "login_bottom" & gt; & Lt ;? = Form_submit ($ login_button) ;? & Gt; & Lt; / Div & gt; & Lt ;? = Form_Close () ;? & Gt;
It is possible to use a place instead of "" for the button. It could work.
Comments
Post a Comment