Tag Archives: codeigniter

Codeigniter http -> https found 302

Questions: I’m developing a web-site with Codeigniter framework where I would want to secure my login functionality and some of my controllers. For implementing this I’m using http://sajjadhossain.com/2008/10/27/ssl-https-urls-and-codeigniter/ -method. In some reason while form (POST) submitting I get 302 found and the request have been redirected to http GET -request. As a result I lose… Read More »

Upload multiple files in CodeIgniter

Questions: In my CodeIgniter project I’m uploading files during the project creation. Here’s the uploading function: function uploadFiles(){ $this->load->library(‘upload’); $error = 0; $projectName = $_POST[‘projectname’]; mkdir(‘./uploads/’.$projectName); for($i=0; $i<count($_FILES); $i++) { $_FILES[‘userfile’][‘name’] = $_FILES[‘files’][‘name’][$i]; $_FILES[‘userfile’][‘type’] = $_FILES[‘files’][‘type’][$i]; $_FILES[‘userfile’][‘tmp_name’] = $_FILES[‘files’][‘tmp_name’][$i]; $_FILES[‘userfile’][‘error’] = $_FILES[‘files’][‘error’][$i]; $_FILES[‘userfile’][‘size’] = $_FILES[‘files’][‘size’][$i]; $config[‘upload_path’] = ‘./uploads/’.$projectName; $config[‘allowed_types’] = ‘xml|etl’; $config[‘max_size’] = ‘0’; $config[‘overwrite’]… Read More »

How can I have CodeIgniter load specific pages using SSL?

Questions: How can I have CodeIgniter load specific pages using SSL? I have an apache2/mode_ssl server. mod_ssl uses a different document root than non-secure pages. For example, https (port 443) would serve pages out of /var/www/ssl_html/ And http (port 80) serves pages out of /var/www/html/. How would I get CodeIgniter to play nice with this… Read More »

Codeigniter – Using Multiple Databases

Questions: database.php: $db[‘default’][‘hostname’] = “192.168.2.104”; $db[‘default’][‘username’] = “webuser”; $db[‘default’][‘password’] = “—-“; $db[‘default’][‘database’] = “vad”; $db[‘default’][‘dbdriver’] = “mysql”; $db[‘default’][‘dbprefix’] = “”; $db[‘default’][‘pconnect’] = TRUE; $db[‘default’][‘db_debug’] = TRUE; $db[‘default’][‘cache_on’] = FALSE; $db[‘default’][‘cachedir’] = “”; $db[‘default’][‘char_set’] = “utf8”; $db[‘default’][‘dbcollat’] = “utf8_general_ci”; $db[‘stats’][‘hostname’] = “192.168.2.104”; $db[‘stats’][‘username’] = “webuser”; $db[‘stats’][‘password’] = “—“; $db[‘stats’][‘database’] = “vad_stats”; $db[‘stats’][‘dbdriver’] = “mysql”; $db[‘stats’][‘dbprefix’] =… Read More »

CodeIgniter + jQuery(ajax) + HTML5 pushstate: How can I make a clean navigation with real URLs?

Questions: I’m currently trying to build a new website, nothing special, nice and small, but I’m stuck at the very beginning. My problems are clean URLs and page navigation. I want to do it “the right way”. What I would like to have: I use CodeIgniter to get clean URLs like “www.example.com/hello/world” jQuery helps me… Read More »

CodeIgniter – why use xss_clean

Questions: if I’m sanitizing my DB inserts, and also escaping the HTML I write with htmlentities($text, ENT_COMPAT, ‘UTF-8’) – is there any point to also filtering the inputs with xss_clean? What other benefits does it give? Answers: xss_clean() is extensive, and also silly. 90% of this function does nothing to prevent xss. Such as looking… Read More »

Codeigniter Routes regex – using dashes in controller/method names

Questions: I’m looking for a one line route to route dashed controller and method names to the actual underscored controller and method names. For example the URL /controller-name/method-name-which-is-long/ would route to /controller_name/method_name_which_is_long/ see: http://codeigniter.com/forums/viewreply/696690/ which gave me the idea to ask 🙂 Answers: That is exactly my requirement too and I was using routes like… Read More »

Best method of including views within views in CodeIgniter

Questions: I’m starting a large codeigniter project and would like to try to create some reusable ‘mini’ views for snippets of content like loops of data which may be displayed on different pages/controllers. Is it better to call the views from within the main controller’s view? If so, how? Or should I call the ‘mini… Read More »

Error: Connection Reset (Firefox) on CodeIgniter

Questions: I have a problem, On some computers the following message appears in the browser when I try to access the link from my application: Connection reset (Firefox); This page can not be displayed (IE). Cause of the problem: Warsaw (security module of Bank of Brazil, Caixa Economica…) There’s something blocking access to the application… Read More »