I can't send a AJAX request in a codeigniter server - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: I can't send a AJAX request in a codeigniter server (/showthread.php?tid=77327) Pages:
1
2
|
I can't send a AJAX request in a codeigniter server - kaiserf50 - 08-17-2020 Hello, everybody. I'm developing an app in codeigniter 4, the fact is that I have already correctly configured my test server and when I make a request via ajax it returns 404 and "index.php", I have already tried everything and the problem still remains RE: I can't send a AJAX request in a codeigniter server - InsiteFX - 08-18-2020 If you want help on this you will need to show your controller code and ajax code. RE: I can't send a AJAX request in a codeigniter server - includebeer - 08-20-2020 With the few information you give, it may be because your ajax request doesn’t call the right URL or there’s an error in your route configuration. RE: I can't send a AJAX request in a codeigniter server - kaiserf50 - 08-21-2020 (08-18-2020, 03:47 AM)InsiteFX Wrote: If you want help on this you will need to show your controller code and ajax code.Here is my code JavaScript Code: $(document).on('submit', '#login', function(e){ Controller PHP Code: <?php namespace App\Controllers; Routes.php PHP Code: /*Rutas para login*/ In the development Enviroment works perfectly, but in a Docker container not, RE: I can't send a AJAX request in a codeigniter server - InsiteFX - 08-21-2020 Try this your url is wrong. PHP Code: url: "<?= base_url(login/signin');?>", RE: I can't send a AJAX request in a codeigniter server - jreklund - 08-21-2020 If your Docker dosen't work, it dosen't read the .htaccess file to enable SEO-friendly URLs, nothing to do with CodeIgniter. If your urls work with index.php/signin, you could use site_url() to generate said urls. But that would mean all your urls contain index.php just because a miss-configured docker environment. RE: I can't send a AJAX request in a codeigniter server - stlake2011 - 08-24-2020 A little late to the party here but, feeding jreklund's post, if your using apache, make sure your mod_rewrite is enabled. I was having this problem on an ajax myself and as soon as I looked at my .htaccess file it hit me square between the eyes that was what I forgot to do. RE: I can't send a AJAX request in a codeigniter server - svennd - 08-25-2020 Totally offtopic, but md5() and passwords are a very bad idea ! https://www.php.net/manual/en/function.md5.php RE: I can't send a AJAX request in a codeigniter server - valema - 08-27-2020 Could it matter weather it's a GET or a POST request? I'm quite certain that if you use GET the controller method doesn't need a route... RE: I can't send a AJAX request in a codeigniter server - kaiserf50 - 11-03-2020 hey guys, sorry by the late, I fix it!!, the reason: the httaccess files cannot reading by the apache2, so, i fix the container with a volume, thanks a lot for the help |