0

in my controllers/automation.php file, I have:

class Automation extends CI_Controller {
       // some code here
       public function search() {
           // implementation of the search function
       }
}

Now, on my library.js file I have:

function search()
{
    var date = $("#datepicker").val();
    $.post('./automation/search', { date : date.toString() },
        function(answer){
            alert(answer);
        }
      );
    return;
}

However, firebug shows:

POST http://localhost/ci/automation/search 404 Not Found

what would be the correct url then?

cybertextron
  • 10,547
  • 28
  • 104
  • 208

1 Answers1

1

Try http://localhost/ci/index.php?automation/search. That would be the default if you haven't used .htaccess to modify paths so you don't need index.php.

If that's the case and you want to get rid of index.php in your paths, google will give you plenty of resources. One example is here.

Community
  • 1
  • 1