codeigniter

Parentheses passed in url break codigniter query

陌路散爱 提交于 2020-01-16 03:56:08
问题 I have a string being passed via an URL to a Codeigniter driven site. The string is urlencoded before being passed, then urldecoded by the controller before being passed to a function in the model that searches for the string in a database table. I've read several other posts/articles on this, but none offer a viable (for me) solution to the issue. Here are some of the things I have read: URL having parentheses not working in codeigniter with datamapper ORM Parenthesis issue in codeigniter

Codeigniter : unable to connect to database, server error

不问归期 提交于 2020-01-16 01:20:11
问题 I have a codeigniter web application which is working in lamp but not working in wamp. When I try to access the site it gives the following error Unable to connect to your database server using the provided settings. Filename: E:\wamp\www\CI\system\database\DB_driver.php Line Number: 114 I have used mysql and sqlite in my application. Database.php $active_group = 'default'; $active_record = TRUE; $db['login']['hostname'] = 'localhost'; $db['login']['username'] = 'root'; $db['login']['password

Codeigniter throws 404 after uploading to server

徘徊边缘 提交于 2020-01-16 00:45:24
问题 My project runs well on localhost but throws a 404 when I upload the files to a server. Wnen I try to access another page on the system, eg www.myadress.com/newController it throws a 500 internal server error. What could be the problem? This is what my routes look like $route['default_controller'] = 'home'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; 回答1: use this. in config.php $config['base_url'] = ''; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO';

Codeigniter throws 404 after uploading to server

烂漫一生 提交于 2020-01-16 00:45:03
问题 My project runs well on localhost but throws a 404 when I upload the files to a server. Wnen I try to access another page on the system, eg www.myadress.com/newController it throws a 500 internal server error. What could be the problem? This is what my routes look like $route['default_controller'] = 'home'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; 回答1: use this. in config.php $config['base_url'] = ''; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO';

Insert data from datepicker in database using php

邮差的信 提交于 2020-01-15 23:58:53
问题 I have a problem and I can't resolve it, So my script: <script> $(document).ready(function() { $("#datepicker").datepicker({ format: 'dd-mm-yy' }); }) My html: <div class="form-group"> <label>Date:</label> <input class="form-control marg-left-10" name="date" type="text" id="datepicker"> </div> My php: $date = date('dd-mm-yy', strtotime($this->input->post['date'])); But the date doesn't insert, in my database the date look like this : 0000-00-00 Help me please 回答1: Use the appropriate format /

Paypal Adaptive payment minibrowser

 ̄綄美尐妖づ 提交于 2020-01-15 18:53:08
问题 I'm trying to use Paypal adaptive payment using mini browser option using Codeigniter framework in PHP for my products. When I click on pay button, the mini browser opens nice but when I click on Login buttons new tab opens but I want to open this login open in existing mini browser. The view file: <html> <head> <script src="https://www.paypalobjects.com/js/external/apdg.js" type="text/javascript"></script> </head> <body> <?php echo form_open_multipart('pay/splitPay','target="PPDGFrame"',

Paypal Adaptive payment minibrowser

£可爱£侵袭症+ 提交于 2020-01-15 18:52:34
问题 I'm trying to use Paypal adaptive payment using mini browser option using Codeigniter framework in PHP for my products. When I click on pay button, the mini browser opens nice but when I click on Login buttons new tab opens but I want to open this login open in existing mini browser. The view file: <html> <head> <script src="https://www.paypalobjects.com/js/external/apdg.js" type="text/javascript"></script> </head> <body> <?php echo form_open_multipart('pay/splitPay','target="PPDGFrame"',

If session expires, automatically redirect home - Codeigniter

那年仲夏 提交于 2020-01-15 12:09:35
问题 Is there somewhere in codeigniter where I could configure an automatic redirect to my root page if the user's session is expired (I am not trying to extend the session expiration's time)? Situational example: User logs in, leaves page idle for one day, returns to page that requires validated session and sees PHP errors everywhere. I'd prefer for anything in this situation to be redirected to my root login page. Thank you! 回答1: put this content into your constructor function because when the

I want to resize uploaded image in codeigniter but it is not working

大憨熊 提交于 2020-01-15 11:17:52
问题 I want to resize uploaded image in codeigniter but it is not working with this code. Image uploading successfully but I want to resize it to 110x110 and display it ! my code is here class Upload_photo extends CI_Controller{ function __construct() { parent::__construct(); $this->load->helper(array('form', 'url')); } public function index(){ session_start(); $u = $_SESSION['username']; $config['upload_path'] = 'user/'.$u.'/'.$filename; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size

Wordpress Codeigniter Integration: How to replace site_url on CI?

南笙酒味 提交于 2020-01-15 10:54:50
问题 I have some problem with URL of Wordpress and Codeigniter integration, because I want to avoid data collisions between WP and CI site_url. Here is my code on CI : config.php $config['base_url'] = 'http://www.mydomain.com'; my_helper.php add_filter('site_url', 'ci_site_url', 1); function ci_site_url() { include(APPPATH.'/config/config.php'); return $config['base_url']; } It works fine and show http://www.domain.com when I use <?php echo site_url(); ?> I want http://www.domain.com/index.php