Welcome Guest, Not a member yet? Register   Sign In
Login form posting username = 0 and passord = md5 of 0 ...
#1

[eluser]jim-_-[/eluser]
I use the exact same login form on another CI site hosted on the same server

I have been trying to fix this for hours, all the same libraries and helpers are loaded.


Its just like the form never gets any info... what can be different I have done ?

The site works in every other way, there are selects that go to the database en get other things...

Model
Code:
function validate()
{  

  $this->db->where('active', TRUE);
  $this->db->where('username', $this->input->post('username'));
  $this->db->where('pass1word', md5($this->input->post('password')));
  $query = $this->db->get('membership');
  
  if($query->num_rows == 1)
  {
   return true;
  }
}

Controller
Code:
function index(){
  $data['main_content'] = 'login_form';
  $this->load->view('includes/template', $data);
}
function validate_credentials()
{
  $this->load->model('membership_model');
  $query = $this->membership_model->validate();
  
  if($query)
   {
   $data = array(
    'username' => $this->input->post('username'),
    'is_logged_in' => true
    );
    
    $this->session->set_userdata($data);
    redirect();
   }
  else
  {
    redirect($this->session->flashdata('goback'));
  }
  
}

this is the form that gives nothing
Code:
<div id="login_form">
<h1>Login doode!</h1>
// this is just to keep info for a back button later.
&lt;?php $this->session->keep_flashdata('goback');
echo form_open('login/validate_credentials');

echo form_input(array(
  'name' => 'username',
  'id' => 'username',
  'value' => '',
  'placeholder' => 'Username'
));
echo form_password(array(
  'name' => 'password',
  'id' => 'password',
  'value' => '',
  'placeholder' => 'Password'
));
echo form_submit('submit', 'Login');
?&gt;
</div>

(goes to the controller again)

returns the info below.

I put the 1 into password to get this output in the browser. other wise i just get the username or password incorrect message.
Code:
SELECT * FROM (`membership`) WHERE `active` = 1 AND `username` = 0 AND `pass1word` = 'd41d8cd98f00b204e9800998ecf8427e'
#2

[eluser]Abel A.[/eluser]
We're going to need a lot more details than that in order to help you.
#3

[eluser]jim-_-[/eluser]
yeah sorry still adding.
#4

[eluser]jim-_-[/eluser]
found it...


After 5 hours I find it 5 minutes after I post here..

There was an error i my .htaccess that made all post data f off. copied, the .htaccess file from another domain...

http://ellislab.com/forums/viewthread/144260/#758827


5hours wasted... damn I wish I was wasted..




Theme © iAndrew 2016 - Forum software by © MyBB