codeigniter

adding timestamp while uploading image file is not working

天涯浪子 提交于 2020-06-29 03:41:55
问题 I am developing a ad site that anyone able to upload 3 images. So I am coding to upload that 3 images by adding timestamp in front of their file name to make them unique. I use codeigniter framework and attaching the code below. when I submitting form data, localhost server shows that images have been saved correctly with some code infornt of image filename. But problem is there are no images saved in relevant image folder in that name and I cannot retrieve that images in next preview

Avoid error 403 in codeigniter on a second POST request

强颜欢笑 提交于 2020-06-28 08:13:51
问题 I can't understand why I cannot do more than one request without refreshing page. Any request is working fine, but If I need to execute another request (don't mind if it's the same or not)... I can't! I need to refresh the page to do a new request, otherwise, I'll get error 403. All the code is working, just, any request is finishing with refreshing the page. I don't like that because I consider it's not professional. What do I need to change in codeigniter to allow more than one request

Passing JSON from controller to view in codeigniter

点点圈 提交于 2020-06-28 04:01:15
问题 I made an API call and received the response in JSON format. JSON: { "Specialities": [ { "SpecialityID": 1, "SpecialityName": "Eye Doctor" }, { "SpecialityID": 2, "SpecialityName": "Chiropractor" }, { "SpecialityID": 3, "SpecialityName": "Primary Care Doctor" } ] } Controller File: public function index(){ $data= json_decode(file_get_contents('some_url')); $this->load->view('my_view',$data); } Above code doesn't work because in view I can't access the nested object properties. However I am

how to fix error Cannot modify header information - headers already sent by [duplicate]

牧云@^-^@ 提交于 2020-06-27 16:30:32
问题 This question already has answers here : How to fix “Headers already sent” error in PHP (11 answers) Closed 3 years ago . I have following type of error in codeigniter, I am unable solve it any one have idea what is cause of this error. A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /home/samples1/public_html/venture-test/application/controllers/admin/admin_notifications.php:158) Filename: helpers/url_helper

How to integrate Skrill in CodeIgniter?

走远了吗. 提交于 2020-06-26 14:37:14
问题 I am using codeigniter and looking for integration of Skrill payment gateway but didn't get exact information from anywhere. I have already follow steps from example but it's not going to redirect on my status-url (outside of CodeIgniter). I have tried one another example with below code but it's also not working $config['pay_to_email']="abcdef@gmail.com"; $config ['status_url'] = 'http://myserver/response.php'; $config ['language'] = 'EN'; $config ['amount'] = '1'; $config ['currency'] =

SASS with Codeigniter

让人想犯罪 __ 提交于 2020-06-25 09:43:11
问题 I have a big codeigniter project that has been going on / selling for a while. I want to integrate SASS into it however SASS seems mainly - not strictly - for rails. I have been reading up on it and even though there are sparks for codeigniter that will allow SASS, it does not support recent versions of it very well. I have yet to see instructions on how to implement SASS on codeigniter. Anyone can provide some clean instructions please? Thank you ! 回答1: Sass and CodeIgniter does not need to

CodeIgniter - Optional parameters

 ̄綄美尐妖づ 提交于 2020-06-22 11:43:30
问题 I'm building my first CodeIgniter application and I need to make URLs like follows: controllername/{uf}/{city} Example: /rj/rio-de-janeiro This example should give me 2 parameters: $uf ('rj') and $city ('rio-de-janeiro') Another URL possible is: controllername/{uf}/{page} Example: /rj/3 This example should give me 2 parameters: $uf ('rj') and $page (3) In other words, the parameters "city" and "page" are optionals. I can't pass something like '/uf/city/page'. I need always or 'city' OR 'page'

CodeIgniter - Optional parameters

♀尐吖头ヾ 提交于 2020-06-22 11:42:17
问题 I'm building my first CodeIgniter application and I need to make URLs like follows: controllername/{uf}/{city} Example: /rj/rio-de-janeiro This example should give me 2 parameters: $uf ('rj') and $city ('rio-de-janeiro') Another URL possible is: controllername/{uf}/{page} Example: /rj/3 This example should give me 2 parameters: $uf ('rj') and $page (3) In other words, the parameters "city" and "page" are optionals. I can't pass something like '/uf/city/page'. I need always or 'city' OR 'page'

How to get data from an array inside session in codeigniter?

只愿长相守 提交于 2020-06-17 12:56:30
问题 i want to get data from an array inside of session. i want to get the name of each array. But when i print $x and $y like in the code below, it doesn't print anything THE ANSWER BEFORE IS CORRECT BUT HOW ABOUT THIS $this->session->userdata['namearray']; this is print_r of the session Array ( [0] => stdClass Object ( [name] =>a ) [1] => stdClass Object ( [name] =>b ) ) foreach ($this->session->userdata['namearray'] as $x=>$y){ print_r("this is x".$x); print_r("this is y".$y); } 回答1: I've

how to upload more than 2mb file using codeigniter

馋奶兔 提交于 2020-06-17 09:51:19
问题 I am trying uploading a file which is more than 2mb even after setting maximum size in controller but still the file is not getting uploaded.please help to find the solution for this problem. Below is my code: Controller $config['upload_path'] = './abc/'; $config['allowed_types'] = '*'; $config['max_filename'] = '255'; $config['encrypt_name'] = FALSE; $config['overwrite'] = TRUE; //$config['max_size'] = '102400'; //100 MB $config['max_size'] = '25600'; $config['max_width'] = '0'; $config['max