codeigniter

Codeigniter 4: Cannot access the page with apache mode_rewrite

家住魔仙堡 提交于 2021-02-20 03:40:53
问题 I installed Codeigniter 4.0.0.rc3 on my local computer using Wampserver and created a 'people' controller. I can access the page using this address: http://127.0.0.1/election/index.php/people But not without 'index.php': http://127.0.0.1/election/people And this is the error: The requested URL /Projects/Web/election/public/index.php/people was not found on this server. .htaccess is in the public directory and is working because the error shows index.php in the path. This is my htaccess: #

How to use session table in code igniter

岁酱吖の 提交于 2021-02-19 08:21:17
问题 I'm new on code igniter and wanna ask how to use session with session table in database. I have create session table with this sctructure. CREATE TABLE `sys_sessions` ( `session_id` VARCHAR(40) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', `ip_address` VARCHAR(16) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', `user_agent` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci', `last_activity` INT(10) UNSIGNED NOT NULL DEFAULT '0', `user_data` TEXT NOT NULL COLLATE 'utf8_unicode_ci', PRIMARY KEY (

Trailing %20 white space in URLs producing 404 errors in Codeigniter

老子叫甜甜 提交于 2021-02-19 07:16:23
问题 Our URLs with a URL encoded trailing white space ( %20 ) are producing a 404 error. The application is run on Codeigniter on Apache. /directory/page%20 will return a 404 error /directory/page will return a 200 OK How can I route all URLs with a trailing %20 to the intended URL? 回答1: The problem is that some third party websites are linking to us with trailing white space in the HREF In that case you can add something like the following at the top of your .htaccess file to redirect

$.post to Codeigniter Controller/Method 404 Page Not Found

为君一笑 提交于 2021-02-19 06:46:07
问题 I have developed a Codeigniter prototype application and hosted with Godaddy.com during the development phase for testing purposes without issue. This application uses a combination of javascript, jquery, HTML5, CSS and PHP (Codeigniter Framework). This week I have transferred the application to the clients server and have had many configuration issues but finally hit a wall. The client set up a fresh install on a new Linux/Apache2 server with PHP5. mod_rewrite is enabled and allowoverride is

Failed to authenticate password using codeigniter

与世无争的帅哥 提交于 2021-02-18 12:10:24
问题 Failed to authenticate password. Error: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 wv1sm5867206pab.37 - gsmtp function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'gauravkwt@gmail.com', 'smtp_pass' => '92135108845129', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => TRUE ); $this

Failed to authenticate password using codeigniter

久未见 提交于 2021-02-18 12:10:12
问题 Failed to authenticate password. Error: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 wv1sm5867206pab.37 - gsmtp function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'gauravkwt@gmail.com', 'smtp_pass' => '92135108845129', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => TRUE ); $this

Failed to authenticate password using codeigniter

你离开我真会死。 提交于 2021-02-18 12:09:56
问题 Failed to authenticate password. Error: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 wv1sm5867206pab.37 - gsmtp function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'gauravkwt@gmail.com', 'smtp_pass' => '92135108845129', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => TRUE ); $this

Dynamic properties name in PHP

偶尔善良 提交于 2021-02-17 06:19:11
问题 There is an object in PHP named $item , and in this object I have properties of title , title_cn, title_tw And I would like to create an function that auto generate the properties based on the language, so I coding like this: <?= $item->title . set_lang(); ?> And the function: function set_lang() { $CI =& get_instance(); $lang = $CI->session->userdata('site_lang'); if ($lang == "english") { return ""; } else if ($lang == "zh_tw") { return "_tw"; } else if ($lang == "zh_cn") { return "_cn"; }

how to get sum of a column with codeigniter query [duplicate]

馋奶兔 提交于 2021-02-17 05:54:08
问题 This question already has an answer here : codeigniter - how to add up values in table column (1 answer) Closed 1 year ago . I am trying to get sum of a column values in mysql table with the codeigniter query as $this->db ->query("Select SUM(tb1.amount) from table1 tb1 inner join table2 tb2 on tb2.Id=tb1.Id Where tb2.Status='1'") ->result() it give me error as array to string conversion I need just a number such count(amount) returns number of rows with num_row() 回答1: use as => $data['total']

Codeigniter Delete … Where … and

血红的双手。 提交于 2021-02-17 03:22:21
问题 I need a little help. How can i send this query with codeigniter? Delete FROM friendconnect WHERE who = 5 and whos = 1 OR whos = 5 and who = 1; I found only that: $this->db->where('id', $id); $this->db->delete('mytable'); Thanks everybody! 回答1: $this->db->where('who', 5); $this->db->where('whos', 1); $this->db->or_where('whos', 5); $this->db->where('who', 1); $this->db->delete('friendconnect'); This is also an alternative: $this->db->where('who', 5)->where('whos', 1)->or_where('whos', 5)-