• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
access to subFolder from subFolder

#4
[eluser]Mutsop[/eluser]
Well these are the two files I have:

application/controllers/admin/login.php
Code:
<?php

class Signup extends Controller {

    public function __construct() {
        parent::Controller();

        $this->load->helper(array('form','url'));
        $this->load->library('form_validation');
    }
    public function index() {
        $this->load->view('admin/login');
    }
    public function submit() {
        if ($this->_submit_validate() === FALSE) {
            $this->index();
            return;
        }
        // $this->load->view('submit_success');
    }
    private function _submit_validate() {
        // validation rules
        $this->form_validation->set_rules('username', 'Username', 'required');
        $this->form_validation->set_rules('password', 'Password', 'required');
        $this->form_validation->set_message('authenticate','Invalid login. Please try again.');
        return $this->form_validation->run();
    }
}
?>

application/views/admin/login.php
Code:
<!DOCTYPE html>
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;title&gt;Admin Panel&lt;/title&gt;
    &lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;css/style.css"
        type="text/css" media="all"&gt;
&lt;/head&gt;
&lt;body&gt;
    <div id="admin_login_form">
        &lt;?php echo validation_errors(); ?&gt;
        &lt;?php echo form_open('admin/login/submit'); ?&gt;
            <p>
                <label for="username">Username: </label>
                &lt;?php echo form_input('username'); ?&gt;
            </p>
            <p>
                <label for="password">Password: </label>
                &lt;?php echo form_password('password'); ?&gt;
            </p>
            <p>
                &lt;?php echo form_submit('submit','Login'); ?&gt;
            </p>
        &lt;?php echo form_close(); ?&gt;
    </div>
&lt;/body&gt;
&lt;/html&gt;

So the placement should be good...


Messages In This Thread
access to subFolder from subFolder - by El Forum - 11-03-2010, 06:45 AM
access to subFolder from subFolder - by El Forum - 11-03-2010, 07:27 AM
access to subFolder from subFolder - by El Forum - 11-03-2010, 07:43 AM
access to subFolder from subFolder - by El Forum - 11-03-2010, 08:13 AM
access to subFolder from subFolder - by El Forum - 11-03-2010, 08:22 AM
access to subFolder from subFolder - by El Forum - 11-03-2010, 08:26 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.