Function and DB questions - 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: Function and DB questions (/showthread.php?tid=74385) |
Function and DB questions - Mekaboo - 09-17-2019 Hey all! Questions: 1. I have this controller/function in my site(<?= anchor('register/cichat','Chat');?>) but when link is clicked it shows this http://REDACTED.com/index.php/register/login.php which leads to a 404 page not found. Being that the login function doesnt even exist why is it showing? This is the route I have:"$route['chat'] = 'chatpage(view file)';". How do I change this if possible? 2. Also Im trying to upload a table into my DB but the charset is not in the list of available sets(latin1). How do I upload the sql into my DB for my code to work? Thank ya kindly all! , Mekaboo RE: Function and DB questions - Wouter60 - 09-18-2019 What is your $config['base_url'] value in application/config/config.php ? Which other routes do you have in application/config/route/php ? Which CodeIgniter version do you use? RE: Function and DB questions - Mekaboo - 09-18-2019 (09-18-2019, 09:51 AM)Wouter60 Wrote: What is your $config['base_url'] value in application/config/config.php ?Hey there Sir! Here are your answers: Base url: 'http://REDACTED.com/' ( I noticed someone edited my post and changed the url) "Routes" $route['default_controller'] = 'welcome'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; $route['login'] = 'login'; $route['register'] = 'register'; $route['user'] = 'user'; $route['form'] = 'form'; $route['validation'] = 'Form'; $route['redirect/profile'] = 'Login/profile'; $route['chat'] = 'chatpage'; $route['verifyEmail/(:any)'] = 'users/verifyEmail/$1'; $route['forgotPassword'] = 'users/forgotPassword'; $route['resetPassword/(:any)'] = 'users/resetPassword/$1'; Im using CI version 3.1.10. Thank ya for the help RE: Function and DB questions - Wouter60 - 09-18-2019 You say the anchor in your view points to register/cichat. I don't see a route for that, so CI expects to have a controller named "Register" and in that controller a function named "cichat". If you don't have that, a 404 error will occur. Routes like PHP Code: $route['login'] = 'login' You also said you have this route: PHP Code: $route['chat'] = 'chatpage'; //view file RE: Function and DB questions - Mekaboo - 09-19-2019 (09-18-2019, 10:52 PM)Wouter60 Wrote: You say the anchor in your view points to register/cichat.Super..will make this change soon within project..thanks alot |