Welcome Guest, Not a member yet? Register   Sign In
404 how make a rote

I send ajax to server
          type: 'POST',
          url: '/functions_ajax/check_all_Ukraine',

There is a server side
class Functions_ajax extends CI_Controller {

public function __construct()
    parent:: __construct();
    $firephp = FirePHP::getInstance(true);
    $firephp -> fb("hello world! i'm warning you!",FirePHP::WARN);
    public function check_all_Ukraine(){
        echo json_encode($data);
        echo json_encode(NULL);


And this is A route
$route['functions_ajax/check_all_Ukraine'] = 'functions_ajax/check_all_Ukraine';

But I still have 404 error

Use this for the url:
PHP Code:
url'<?php echo site_url();?>functions_ajax/check_all_Ukraine'

Firstly define base_url in header.

<script type="text/javascript">
      var site_url = '<?php echo site_url(); ?>';
      var base_url = site_url;
      var siteurl = site_url;

after that you can use url something like that where you want in whole project files.
          type: 'POST',
          url: siteurl+'functions_ajax/check_all_Ukraine',

@ XtreemDeveloper

Note: base_url() and site_url() are not the same thing.

base_url() = http://www.yoursite.com

site_url() = http://www.yoursite.com/index.php
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Every time I log onto this forum I find something helpful that I didn't even know I needed... thanks XtremeDeveloper and InsiteFX!

Theme © iAndrew 2016 - Forum software by © MyBB