Welcome Guest, Not a member yet? Register   Sign In
No POST data received
#1

[eluser]mast3rpyr0[/eluser]
Hey all, been having this weird issue with a brand new CI application(just downloaded the latest version). Nothing that I input into a login form is passed to the controller I'm posting too. What I have tried so far:

I have checked that mod_rewrite is enabled, it is.

Base_url is set correctly.

I have tried all 5 uri_protocols, most of which break everything and the ones that do work give the same issues.

index_page is blank for mod_rewrite usage.

The only thing that I can think of is my .htaccess being wrong or I missed something in my server config; I am not strong in apache configuration. Or its just something really simple that I am over thinking, but i can't find it...

Here are relevant code samples, thanks in advanced if anyone can manage to help me find the issue.

Link here, it could be an issue locally as well, however its happened on all devices on my network: http://aaronblankenship.com/devzone/site/

.htaccess
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /devzone/site/

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.

    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

account/login function
Code:
public function login()
{
  $this->form_validation->set_rules('username', 'Username', 'trim|required|max_length[24]');
  $this->form_validation->set_rules('password', 'Password', 'trim|required|md5');

  if($this->form_validation->run() == false)
  {
   echo validation_errors();
   $this->output->enable_profiler(TRUE);
  }
  else
  {
   $user = $this->input->post('username');
   $password = $this->input->post('password');;
   $sessiondata = array(
    'username' => $user,
    'loggedin' => true
   );
  
   $this->session->set_userdata($sessiondata);
   redirect(base_url());
  }
}

login form
Code:
&lt;?=form_open(base_url().'account/login');?&gt;
      &lt;input type="text" id="username" placeholder="Username" /&gt;
      &lt;input type="password" id="password" placeholder="Password" /&gt;
      &lt;input type="submit" value="Submit" /&gt;
     &lt;?form_close();?&gt;
#2

[eluser]bobbob[/eluser]
Code:
$this->load->library('form_validation');

is missing in your controller
#3

[eluser]mast3rpyr0[/eluser]
Oh forgot to mention I autoload that.
#4

[eluser]psychoder[/eluser]
i think you forgot the name of your form fields...
#5

[eluser]mast3rpyr0[/eluser]
wow, kidding me >< i figured it would take IDs.. i feel like an idiot now lol thanks




Theme © iAndrew 2016 - Forum software by © MyBB