CodeIgniter Forums
having trouble implimenting ion auth into my web application. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: having trouble implimenting ion auth into my web application. (/thread-53505.html)



having trouble implimenting ion auth into my web application. - El Forum - 07-26-2012

[eluser]bradyrose[/eluser]
Hello,

i am having some problems getting ion auth to function in my web application,

you can see the errors i am receiving here:

http://www.cashforbtc.com/index.php/pages/view/login2

If someone does not immediately know what mistake i am making, I will update this thread with my controller/ view, etc. I'm pretty sure im just missing something.




having trouble implimenting ion auth into my web application. - El Forum - 07-26-2012

[eluser]solid9[/eluser]
The problem is very basic.
You forgot to pass the variables into array through view properly.


having trouble implimenting ion auth into my web application. - El Forum - 07-26-2012

[eluser]bradyrose[/eluser]
here is what i have in my view, I guessed that this is likely something simple, but i am still uncertain how I would go about passing such variables.


Code:
<?php
echo "<br><br><br>";
echo form_open('login/check'); ?&gt;

<fieldset>
    <legend>login Credentials<legend>

    <label for="identity">&lowast; Identity</label>
    &lt;input type="text" name="identity" id="identity" value="&lt;?php echo set_value('identity');?&gt;" /&gt;
    &lt;?php echo form_error('identity');?&gt;

    <label for="password">&lowast; Password</label>
    &lt;input type="password" name="password" id="password" value="&lt;?php echo set_value('password');?&gt;" /&gt;
    &lt;?php echo form_error('password');?&gt;

    <label for="message">&lowast; Message</label>
    &lt;input type="text" name="message" id="message" value="&lt;?php echo set_value('message');?&gt;" /&gt;
    &lt;?php echo form_error('message');?&gt;
</fieldset>

&lt;?php echo form_close();?&gt;



having trouble implimenting ion auth into my web application. - El Forum - 07-26-2012

[eluser]bradyrose[/eluser]
this is my pages controller, also amoung my controllers is the one you install with ion auth:


Code:
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Pages extends CI_Controller {

public function index()
{
  $this->load->view('index');
}



public function view($page = 'home')
    {

// show an error ir the page doesnt exist for some reason  
if ( ! file_exists('application/views/pages/'.$page.'.php'))
  {
  // Whoops, we don't have a page for that!
  show_404();
  }
  
//Capitalize the first letter of the title
$data['title'] = ucfirst($page);

// load all the helpers and libraries to be used  
$this->load->library('pmsystem');
$this->load->library('session');
$this->load->database();
$this->load->library('table');
$this->load->library('pagination');
$config['base_url'] = 'http://www.cashforbtc.com/index.php/feedback';
$config['total_rows'] = 300;
$config['per_page'] = 3;
$this->pagination->initialize($config);
$this->load->helper('url');
$this->load->helper('form');
$this->load->helper('captcha');

// load all the sections of the page

$this->load->view('templates/header', $data);
$this->load->view('templates/navbar', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);

}

}



having trouble implimenting ion auth into my web application. - El Forum - 07-26-2012

[eluser]solid9[/eluser]
In your controller Pages, Index Method do this,

Code:
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Pages extends CI_Controller {

public $data = array();

public function index()
{
  $this->data['identity'] = $this->input->post('identity');
  $this->data['identity'] = $this->input->post('password');
  $this->load->view('index', $data);
}

or you can try like this,
Code:
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Pages extends CI_Controller {

public $data = array();

public function index()
{
  $this->data['identity'] = '';
  $this->data['identity'] = '';
  $this->load->view('index', $data);
}

It's untested so just post if you encounter error.