codeigniter

i18n URIs with CI Routing or mod_rewrite

笑着哭i 提交于 2019-12-25 01:26:59
问题 I'm trying to clean up my URIs on a multi-language CI site by changing the segment containing the language name to just the two-character language code. Currently, my URIs look like this: http://example.com // Home (English) http://example.com/english/home // Home (English) http://example.com/home // 404 (should go to english/home) http://example.com/sv // 404 (should go to swedish/home) http://example.com/swedish/home // Home (Swedish) http://example.com/sv/home // 404 (should go to swedish

jQuery.post(), PHP and redirects

痞子三分冷 提交于 2019-12-25 01:26:56
问题 THIS PROBLEM IS NOW SOLVED. THANK YOU TO EVERYONE WHO REPLIED. Hello, I am trying to solve a problem that I may have approached from the wrong direction, so maybe someone could suggest a better solution. I am writing a little web app for work, that has a search function. When user submits a search string, form gets posted to a CodeIgniter controller. If search returns a result, CodeIgniter loads a page with results. If there is no results, user's current page just gets reloaded, without any

CodeIgniter's file upload library ignores allowed_types?

佐手、 提交于 2019-12-25 01:26:34
问题 I tried to upload a certificate file and failed: $config["allowed_types"] = "cer"; $this->load->library("upload", $config); $this->upload->do_upload("fieldname"); I always get the following error, even if I upload a .cer file: The filetype you are attempting to upload is not allowed That is a lie, I uploaded a file of an allowed type! Why does this class ignore its documented setting allowed_types? 回答1: You need to add the mime type in mimes.php config file. It should be something like this:

Morris line chart

倾然丶 夕夏残阳落幕 提交于 2019-12-25 01:22:07
问题 i am using morris line chart in my application, Here everything is complete but on x axis i wrote 1 then it display 1910 but i want there current month and date not year. means i want date in place of list of year. Here is my code: Morris.Line({ element: 'line-example', data: [ { time: '1', a: 0, b: 0 }, { time: '2', a: 0, b: 0 }, { time: '3', a: 0, b: 0 }, { time: '4', a: 0, b: 0 }, { time: '5', a: 0, b: 0 }, { time: '6', a: 0, b: 0 }, { time: '7', a: 0, b: 0 }, { time: '8', a: 0, b: 0 }, {

Payment form action work on localhost, but is not working on server

梦想的初衷 提交于 2019-12-25 01:17:38
问题 The form action works fine on localhost, however it doesn't work on server. When I click the button pay now on localhost it directs me to the correct URL. But on server it directs me to mywebsite.com/Gateways/Migs/hitmigs . Here is the code in migs:- $form = '<form action="'.base_url('Gateways/Migs/hitmigs').'" method="post" accept-charset="UTF-8"> <input type="hidden" name="Title" value = "Migs Transaction - PHPTravels"> <input type="hidden" name="virtualPaymentClientURL" size="65" value=

Codeigniter Clone Data from table and update it

无人久伴 提交于 2019-12-25 01:12:45
问题 What i am trying to do: Try to Clone Data (Update) from Table "Payment" to "Payment History" Payment Table Payment_ID Payment_Amount Payment_Method Payment_Remark Payment History Table Payment_ID PaymentHistory_ID Payment_Amount Payment_Method Payment_Remark Both have the same column and same data type My Code: Controller public function updateHistory($Payment_ID){ $this->db->select('*'); $this->db->from('Payment'); $this->db->where('Payment_ID', $Payment_ID); $query = $this->db->get(); $this

How to send SMS using PHP CURL function

牧云@^-^@ 提交于 2019-12-25 00:48:32
问题 I have an account in a website by which I can send sms to mobile phones. In order to do that at first I need to log in using my id and password and then a page shows up where I put the recipient's mobile number and then my message and finally hit the button to send the message. Now one of my friends told me that I can send sms from my own application through this website using PHP Curl function. I didn't have any prior idea about CURL function so I googled it but I couldn't figure out how to

Why cant get expected result from database in CodeIgniter?

被刻印的时光 ゝ 提交于 2019-12-25 00:25:22
问题 My model like below $values = array_count_values($books); arsort($values); $newArray = array_keys($values); $views_books_array = array_slice($newArray, 0, 5); $result = $this->db->where_in('book_id',$views_books_array)->get('books'); return $result->result_array(); new array will be like below Array ( [0] => 37 [1] => 28 [2] => 31 [3] => 30 [4] => 38 ) but when i get retrieve data it will get data from randomly not what i have given im passing book_id to model and controller my controller

How to add a logo path to my company table in Codeigniter?

大兔子大兔子 提交于 2019-12-25 00:17:29
问题 I have an form for adding companies to my database. I've added a field called Logo. I want to use this field so the user can upload an Logo for their company. I am using the Codeigniter upload class in my form. My company table looks like this: Companies --------- id companyname address postalcode country email website logo My form looks liek this: <tr> <td><?= form_label('Bedrijfsnaam:');?></td> <td><?= form_input('Bedrijfsnaam');?><small> (Spaties niet toegestaan)</small></td> </tr> <tr>

image cropping with codeigniter no GD library - GD2 is intalled

醉酒当歌 提交于 2019-12-24 23:27:53
问题 I am working on media library for a website at the moment, and one of the features is that user can create a cropped version of an image that they upload. My problem however is this, when I try and crop the image, I get the following error, The path to the image is not correct. Here is my code, $config['image_library'] = 'gd2'; $config['source_image'] = "/media/images/products/".$this->data['image']; //die($config['source_image']); $config['maintain_ratio'] = FALSE; $config['x_axis'] = $this-