Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,109
» Latest member: Bloodseeker
» Forum threads: 67,629
» Forum posts: 422,799

Full Statistics

Latest Threads
CodeIgniter 3.1.7 unbuffe...
Forum: Issues
27 minutes ago
» Replies: 3   » Views: 142
Lost session
Forum: CodeIgniter 4 Support
42 minutes ago
» Replies: 22   » Views: 405
CodeIgniter 3.x.x Branch ...
Forum: CodeIgniter 3.x
51 minutes ago
» Replies: 3   » Views: 189
Missing Argument Error
Forum: General Help
3 hours ago
» Replies: 1   » Views: 51
blank admin page
Forum: General Help
3 hours ago
» Replies: 1   » Views: 42
language switcher and SEO...
Forum: Best Practices
5 hours ago
» Replies: 2   » Views: 212
If flexi-auth dead?
Forum: Addins
Yesterday, 08:36 PM
» Replies: 0   » Views: 50
CodeIgniter 3.1.8 Release...
Forum: News & Discussion
Yesterday, 08:01 PM
» Replies: 36   » Views: 13,858
Forum: Installation & Setup
Yesterday, 03:34 PM
» Replies: 1   » Views: 85
uploading mp3 files
Forum: Libraries & Helpers
Yesterday, 09:25 AM
» Replies: 11   » Views: 3,759

  thumb quality sucks
Posted by: El Forum - 09-06-2007, 10:10 AM - Forum: Archived General Discussion - Replies (2)

My config:

$config['image_library'] = 'GD';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = FALSE;
$config['width'] = '100';
$config['height'] = '100';
$config['quality'] = '100%';
$config['thumb_marker'] = '_thumb';

Source pic: iniweb.ru/my_pc_2_original.jpg
Thumb pic: http://iniweb.ru/my_pc_2_original_thumb.jpg

How up quality?

P.S. English bad, sorry Smile

  Routes Questions
Posted by: El Forum - 09-06-2007, 09:40 AM - Forum: Archived Development & Programming - Replies (1)

I setup a route for our admin views:
$route['admin/([a-z]+)/([a-z]+)'] = "$1/admin_$2";

Basically this would route something like admin/blog/edit to blog/admin_edit in our blog controller.

However, is there a way that I can do this so that I don't have to pass the index function name in the url? So that admin/blog/ would auto go to blog/admin_index ?

- Andy

  Page views counter + caching?
Posted by: El Forum - 09-06-2007, 08:23 AM - Forum: Archived Development & Programming - Replies (10)

I want to count how many times each of my pages are loaded and also want to use caching. I didn't dig deeply into CI caching mechanisms and i don't know exactly how they are working, so i need an advice. Where is the best place in the code for my counter incrementing routines? I want to avoid situations when a page is loaded from cache and counter isn't triggered.

And second question in this topic: what should i do if i want to additionally display the number of page views on the page (i.e. "This page was viewed 123 times")? I read in the guide that some info such as benchmarking does not cache — how can i mimic this behavior?

Thanks in advance.

  htmldoc is corrupty! why?
Posted by: El Forum - 09-06-2007, 08:06 AM - Forum: Archived Development & Programming - Replies (6)

i use htmldoc to generate my pdf files. i installed the package, but the pdf docs is corrupts. why?

  Automatic Requirements Gatherer
Posted by: El Forum - 09-06-2007, 08:05 AM - Forum: Archived Development & Programming - Replies (1)

Hi all,

Just discovered CodeIgniter and started to redo one of my sites using it, and I am already mighty impressed. I think within a month I will be nothing short of fanatical =)

While this post isn't actually about codeigniter, I noticed this community seems to be pretty active and friendly, so I was hoping I would share my ideas for a project I just started, and see if anyone has any feedback.

The project is for my undergraduate thesis in software engineering and I have decided to make an interview program.

The point of it would be to ask a client questions, and the output of which is both a formal requirements document (can subsequently be used to generate templates, quotes, estimate project length, etc.) and a transcript that includes their justifications and such - that the developer (ie. you) can read to get an understanding of their technical knowledge, expectations, etc.

Technically, I will deliver it using: HTML for the interface, AJAX for the communications, PHP for all the logic and XML for storing requirements, questions, etc.

I only started a few weeks ago, so it is obviously still in it's infant stages, but I am interested to hear what some other developers think of the idea. If it worked well, would you have your clients use it before your first meetings to discuss the scope of the project?

You can find a lot more detailed research and general fluff (along with a very basic prototype that has a whopping 4 questions in it's knowledgebase) at the following site for anyone who is interested:


Thanks in advance to anyone who has feedback. I have spoken with some academics and some management types about it, but very few actual programmers.



  Using query strings normally
Posted by: El Forum - 09-06-2007, 07:46 AM - Forum: Archived General Discussion - Replies (4)

[eluser]Paul Scott[/eluser]
I found myself wanting to be able to specify a variable through GET as-well as through CI's ability to parse the / into parameters of the called function. I was wanting to do this because I was passing a site-wide parameter (it was checked for no matter what page you were on) and I didn't want to have to add the parameter to every function - especially not when some functions had optional parameters.

I found, to my dismay, that trying to go to a url like /admin/main/index?msg=Something returned a 404. A little inspection found that CI was trying to find the controller and function specified by 'msg'.

To fix this, I opened ./system/libraries/Router.php and in the function `_get_uri_string` there is a section that checks if there is only 1 GET variable and uses the name of it to find the controller.

// If the URL has a question mark then it's simplest to just
// build the URI string from the zero index of the $_GET array.
// This avoids having to deal with $_SERVER variables, which
// can be unreliable in some environments
if (is_array($_GET) AND count($_GET) == 1)
    // Note: Due to a bug in current() that affects some versions
    // of PHP we can not pass function call directly into it
    $keys = array_keys($_GET);
    return current($keys);
This is the code block that did it within the `_get_uri_string` function. To counter-act this, I simply changed the if-statement to read
if (FALSE AND is_array($_GET) AND count($_GET) == 1)
Then I needed to stop the GET variable from being destroyed by CI and stop CI trying to take the controller and function from the `c` and `m` $_GET variables by default:
$config['enable_query_strings'] = TRUE;
$config['controller_trigger'] = '';
$config['function_trigger'] = '';

Now I can use URIs like /admin/clients/view/613?msg=updated with my header-template checking for $_GET['msg'] and out-puting it on any page that it's found on.

I thought I would post this because somebody else might have this problem and was wondering why this is the default behaviour? Also, is there a reason why this might have been a bad idea?


  Upload class problem
Posted by: El Forum - 09-06-2007, 02:40 AM - Forum: Archived General Discussion - Replies (4)

I need to upload few files at the same time.

I made an arrray of input elements

<table width="700" border="0" cellpadding="5">
            echo "<tr>";
                echo "<td width=\"200\">Фото ".($i+1)."</td>";
                echo "<td width=\"500\">&lt;input type=\"file\" size=\"50%\" name=\"f[$i]\"&gt;</td>";
            echo "</tr>";
      <td>&lt;input type="submit"&gt;</td>

and in the controller I check if field is not empty and try to upload file.

    $farr = $_FILES['f'];
        if($farr['name'][$i] != "")
            $field = "f[$i]";
            $config['upload_path'] = realpath('public/object');
            $config['allowed_types'] = 'jpg';
            $this->load->library('upload', $config);
            $resarr = $this->upload->data();
            $file = $resarr['file_name'];
            $this->upload->display_errors('<p>', '</p>');

the permission for folder is set 777

and i don't get errors and data about successfull file upload Sad

What I'm doing wrong?

  How to remove GET parameters to avoid a 404?
Posted by: El Forum - 09-06-2007, 01:41 AM - Forum: Archived Development & Programming - Replies (5)


We're migrating our old site to CodeIgniter and are using the Redirect directive in Apache to handle the redirects to our new pages. Our QA just discovered that the Redirect directive will add all the old links' GET parameters to the new CI urls and cause the new CI links to die a nasty 404 death.

So, the question is: what's the best way to chop the GET parameters before CI chokes? Should I use a hook? Are there any suggested or tested / proven solutions to this problem?

Any help is appreciated!

  Coffee Levels critical!!! Cannot function anymore...
Posted by: El Forum - 09-05-2007, 09:47 PM - Forum: Archived Development & Programming - Replies (2)

[eluser]CI Lee[/eluser]
Hey all,

Simple problem, tired eyes....


//$filedata = $this->upload->data();
$data['file_name'] = $data['file_name'];
$file_name = $data['file_name'];
$user_id = $this->session->userdata('id');
// update profile
$sql = "UPDATE profile SET file_name = $file_name WHERE user_id = $user_id LIMIT 1";
$query  = $this->db->query($sql);

Error Number: 1109

Unknown table '67bfa84ce291b67e0c85322e4b2ee20f' in field list

UPDATE profile SET file_name = 67bfa84ce291b67e0c85322e4b2ee20f.jpg WHERE user_id = 5 LIMIT 1

Someone with fresh eyes wanna point out what is wrong? It is not updating at all however "file_name" exists in the db and the user id is correct...

  Disallawed characters in a form
Posted by: El Forum - 09-05-2007, 06:32 PM - Forum: Archived Development & Programming - Replies (2)

hi, i've build a form using the from Helper, it displays ok and it works fine until a submit that form.
i've changes the input library and added a $str to the exit function so i can see what are the characters ( exit('Disallowed Key Characters: '. $str); ).
every time i submit the form it says: Disallowed Key Characters: Array
and i cant figure out why, it all seems to be ok.
here's the form code:

<div id="arch">
    <div id="holder">
// constroi array de anos
$actual = date('Y');
$anos = array();
    $anos[$i] = $actual +$i;    

//constroi array cidades
    $towns[$cidades[$e]['id']] = $cidades[$e]['nome'];

//constroi array tipo de cliente
    $ctipo[$tipocliente[$i]['id']] = $tipocliente[$i]['tipo'];
//constroi array categorias

    $categorias[$cats[$i]['id']] = $cats[$i]['Catnome'];

$data = Array(
                1 => array(
                              'name'        => 'codigo_cliente',
                              'id'          => 'codigo_cliente',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'
                 2 => array('name'        => 'nome',
                              'id'          => 'nome',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                 3 => array('name'        => 'idade',
                              'id'          => 'idade',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                 4 => array('name'        => 'email',
                              'id'          => 'email',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                 5 => array('name'        => 'telefone',
                              'id'          => 'telefone',
                              'maxlength'   => '100',
                              'size'        => '50',
                              'style'       => 'width:50%'),
                 6 => array('name'        => 'description',
                              'id'          => 'description',
                              'rows'        => '15',
                              'cols'        => '100',
                              'style'       => 'width:100%'),
                 7 => array('name'        => 'dia',
                              'id'          => 'dia',
                              'maxlength'   => '2',
                              'size'        => '3'),
                 8 => array(
                              'name'        => 'active',
                              'id'          => 'active',
                              'value'       => '1',
                              'checked'     => TRUE,
                              'style'       => 'margin:10px')
$meses = array('01'=>'Janeiro',
    echo form_open('admin/insert_client');
        echo "c&oacute;digo cliente: <br />".form_input($data[1]."<br />");
        echo "nome: <br />".form_input($data[2]."<br />");
        echo "idade: <br />".form_input($data[3]."<br />");
        echo "email: <br />".form_input($data[4]."<br />");
        echo "telefone: <br />".form_input($data[5]."<br />");
        echo "descri&ccedil;&atilde;o: <br />". form_textarea($data[6])."<br />";
        echo "validade: <br />". form_input($data[7]) ." ". form_dropdown('mes', $meses, '01') ." ". form_dropdown('ano', $anos, $actual) ."<br />";
        echo "tpo de cliente: <br />". form_dropdown('ctipo', $ctipo, '01') ."<br />";
        echo "categoria: <br />". form_dropdown('cat_id', $categorias, '01') ."<br />";
        echo "cidade: <br />". form_dropdown('cid_id', $towns, '01') ."<br />";
        echo "activo: ". form_checkbox('active','active',TRUE) ."<br />";
        echo form_submit('submit', 'Submit Post');
        echo "&lt;/form&gt;"; //form_close();


can you tell me whats wrong?
thanks in advance

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.