Welcome Guest, Not a member yet? Register   Sign In
base_url() codeigniter 3.0.4 duplicate in URL with javascript
#1

I have source code in config.php
PHP Code:
$config['base_url'] = 'http://localhost/metter/'

I have source code in autoload.php
PHP Code:
$autoload['helper'] = array('url','file','form','html','date'); 

I have script with ajax
Code:
   $("#save").click(function(){
       $.ajax({
           type    : 'POST',
           url     : 'save', // if I use '<?php echo base_url();?>' + 'master/Category/save' must error
           data    : $('#form_add').find('input, select, textarea, button').serialize(),
           cache   : false,
           success : function(result){
               window.location="<?php echo base_url('master/Catagory') ?>";
           }
       });
       return false;
   });

process save in php is successfully, but in window.location="....." on URL is
http://localhost/metter/master/Category/...27)%20?%3E

please help me to resolve this..

thanks
Reply


Messages In This Thread
base_url() codeigniter 3.0.4 duplicate in URL with javascript - by ardiaryadi - 03-08-2016, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB