codeigniter-2

How to serve static/media contents (only) from s3 and others from EC2?

本小妞迷上赌 提交于 2019-12-10 10:23:43
问题 I want to serve my static/media contents ( images for now) from S3 but my url should be as it is now. For example: http://example.com/resources/img/me.jpg is one of my current image url which is now being served from the native server (EBS storage came with EC2). Now I want to store this me.jpg file in a bucket of s3 and then if someone types the above url it is brought from there. I know this is possible by creating a bucket name as example.com and www.example.com and then configuring Route

Codeigniter catch database errors

纵然是瞬间 提交于 2019-12-10 10:22:48
问题 I'm looking for a way to catch all the database errors (if and when they occur) and sent an error report my email. For regular php error I extended the CI_Exceptions class and added my email sending code in addition to logging. But the database errors don't go trough CI_Exceptions but instead are logged directly from CI_DB_Driver->query() and I don't want to modify any file in the System folder. Also I don't want to write logging code around every query the app does. 回答1: I'd be tempted to

Why codeigniter2 doesn't store the csrf_hash in a more secure way, such as session?

主宰稳场 提交于 2019-12-10 08:15:36
问题 Why generated CSRF protection token is not saved and used via SESSION like suggested here? Currently in CI2, the CSRF protection mechanism (in Security class) is such: 1.generate a unique value for CSRF token in _csrf_set_hash() function: $this->csrf_hash = md5(uniqid(rand(), TRUE)); 2.Insert that token into form hidden field (using form_open helper) 3.A user submits the form and a server gets the token via POST. The CI performs token verification in "_sanitize_globals()" function in Input

CodeIgniter: Validate form with multidimensional POST data

此生再无相见时 提交于 2019-12-10 03:11:06
问题 So the framework is CodeIgniter 2.0.2. I have a form that has groups of fields that correspond to rows in a database. The names of the fields are in the format: opt[0][foo] opt[0][bar] opt[1][foo] opt[1][bar] etc... The index (1,2,etc...) does not correspond to row IDs in the database, it is simply a way to split up the groups of fields. There may be gaps in the index as users are able to add and remove an arbitrary number of the field groups. All groups are identical, that is, they contain

CodeIgniter - Additional dbforge / migration fields

女生的网名这么多〃 提交于 2019-12-10 00:23:33
问题 Im having trouble figuring out this migrations business for CodeIgniter ... I cant find any decent documentation that explains additional field elements like current_timestamp, default datetime values etc etc I was wondering if someone could help me out to translate the following into proper dbforge->add_field arrays I need the following 2 `last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP and `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' I have

How to upload multiple image with validation in CodeIgniter

北战南征 提交于 2019-12-09 13:56:06
问题 I'm trying to upload multiple images with validation but not able to do so. My view code is as below:- <?php echo form_open("controller/action");?> <ul> <li>Category Image <input type="file" name="category_img"></li> <li>Product Image <input type="file" name="product_img"></li> <li>Slider Image <input type="file" name="slider_img"></li> </ul> <input type="submit" name="submit" class="btn" value="Submit" /> <?php echo form_close();?> Looking forward for a solution. 回答1: Doing it in your way,

Is there any known bug in the session library of CodeIgniter 2.1.0? Why do I get kicked out? [closed]

十年热恋 提交于 2019-12-09 05:47:42
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I'm working on a website which is created with CodeIgniter 2.1.0. I've noticed sometimes when I reload a page couple of times or open a couple of pages

CodeIgniter avatars uploading

久未见 提交于 2019-12-09 03:27:07
问题 Here's the new HTML: <input type="file" name="file_1" /> <input type="text" name="image_description_1" class="text-input"/> Here's the new _submit function: if($this->CI->input->post('file_1')){ $config['overwrite'] = TRUE; $config['allowed_types'] = 'jpg|jpeg|gif|png'; $config['max_size'] = 2000; $config['upload_path'] = realpath(APPPATH . '../assets/uploads/avatars'); $this->CI->load->library('upload', $config); $this->CI->upload->do_upload(); $image_data = $this->CI->upload->data(); $image

Set Cross Domain in Codeigniter

痞子三分冷 提交于 2019-12-09 03:21:35
问题 When ever I run hosted project service run perfectly.. when i test with Other project that give me error or i could not getting response from Services. i try a lot but not working my Ajax Call: self.ValidLogin = function () { try { $.ajax({ type: "GET", url: "http://xxx.xxx.xxx.xxx/TEST/index.php/TestController/TestMethod?UserName=superadmin&Password=super", , crossDomain: true, contentType: "application/json; charset=utf-8", async: false, dataType: 'json', cache: false, success: function

Sending Google API OAuth2 response to Controller [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-08 14:21:14
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am new to CodeIgniter and PHP. Redirect URL given in Google API Console: Redirect URIs: http://localhost/testsaav/index.php/main/gmail_invite Following code shows me Request For Permission page. When I click Allow Access it takes me to http://localhost/testsaav/index.php/main/gmail_invite?code=4/CXD462cen