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



Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,780
» Latest member: LaurenFerlingg
» Forum threads: 67,406
» Forum posts: 421,556

Full Statistics

Latest Threads
Send many emails
Forum: General Help
12 minutes ago
» Replies: 5   » Views: 107
localhost Website
Forum: General Help
13 minutes ago
» Replies: 3   » Views: 60
Bootstrap TagsInput with ...
Forum: General Help
6 hours ago
» Replies: 0   » Views: 37
Facing a Forbidden issue
Forum: CodeIgniter 2.x
6 hours ago
» Replies: 4   » Views: 76
You need to set your "doc...
Forum: CodeIgniter 4 Support
Yesterday, 03:07 PM
» Replies: 2   » Views: 72
Save Codeigniter config d...
Forum: Best Practices
Yesterday, 02:09 PM
» Replies: 2   » Views: 93
Forum: General Help
Yesterday, 11:17 AM
» Replies: 1   » Views: 94
About oAuth2
Forum: General Help
Yesterday, 11:12 AM
» Replies: 3   » Views: 134
Old chestnuts
Forum: CodeIgniter 4 Discussion
Yesterday, 08:33 AM
» Replies: 1   » Views: 51
How to Count the number o...
Forum: General Help
Yesterday, 08:02 AM
» Replies: 12   » Views: 278

  how safe is $this->session ?
Posted by: El Forum - 07-14-2007, 06:38 AM - Forum: Archived General Discussion - Replies (5)

I'm seeing a lot of people using the internal session library where they store if an user is autenticated(and they didn't talk about sessions in the db).
But if i'm storing something like "auth=1" in there
and after that i do an 'var_dump($_SESSION)' i seee the 'auth=1' serialized
I would say that session is a cookie and can be easily tempered with..
Or am i wrong...

  multiple sites, 1 codebase, using symlinks (with smarty)
Posted by: El Forum - 07-14-2007, 01:27 AM - Forum: Archived Development & Programming - Replies (13)

Greetings all,

First, I'd like to say thanks for making a great framework, its flexible and fun to use! I've only been at it a few days but am very impressed. I even managed to get Smarty templates integrated with very little trouble. (not required I know but was my preference)

Now onto the meat ...


My project called for a specific configuration of sites and applications:

site #1: one application
site #2: has both frontend and backend applications
     (will also operate on wildcard sub-domains)
site #3: uses ssl with one application
site #4: one application (internal access)

All 4 sites are heavily related ... and will often want to use the same models, libraries, helpers, views etc. Unfortunately CI doesn't give me a place to store these resources cross-application, and I really didn't feel comfortable editing or extending the core CI classes. That might have made upgrading the framework painful with later releases. I like the idea of just 'dropping in' a new system folder without worry.


So as I was looking into CI initially, I found a lot of posts about running multiple-application sites. Overall, I got the impression that this was something CI 'could' do with tweaking (depending on your specific sites/applications) but wasn't particularly great at out of the box. Thankfully, CI is so easy to work with that there are a number of solutions to consider.

Option 1:

One alternative was to run all my apps out of the same application folder, and just give them unique controllers ... I considered this but thought it might be difficult to keep site #1 from calling site #2's controllers by editing the urls. My sites needed to be fairly secure in this regard.

Option 2:

Another alternative was to modify the loader of the CI core classes to include a new search path, essentially adding a Library level where cross-application code goes. This would have been the most attractive option if I felt more comfortable editing core files. But I don't ... ick! Hopefully CI adopts a similar solution officially in a later release.

Some related links on that method:


And other options I won't get into right now ...


My situation is unique to me perhaps. I happen to own the box my sites are being hosted on, so all configuration options are available. My sites use the traditional php5, mysql5, apache2 on Free(as in beer)BSD. I can edit httpd.conf freely and create .htaccess files as needed.


I found I was able to share a (parent) application folder (located outside each site's root) with a specific site's (local) application folder ... I did this by creating a series of symbolic links in each (local) application folder to represent the corresponding folders in my (parent) application folder ...

I literally matched symbolic links to parent folders exactly ... EXCEPT for the (local) application's 'controllers' folder, which was really the meat of each website.

It might be easier to show you the following folder hierarchy I used:
    my global application folder, where most the code goes
    my CI installs system folder and other files, I leave the version
    number so that I can link to a new system in the index.php if
    needed for testing
    an apache directory alias called common lets me link to subfolders here
    called img, js, css, file, etc. Having one folder with all my includes makes
    it easy to specify in an .htaccess file that CI should leave links alone with
    the word common in it.
    my smarty install, contains the actual libraries
    the site root for site #1
    the site root for site #2
    the site root for site #3
    the site root for site #4

  Fix DSN connect!
Posted by: El Forum - 07-14-2007, 01:07 AM - Forum: Archived Development & Programming - No Replies

[eluser]Claudiu CISMARU[/eluser]
The CI doesn't works properly with DSN!

I've been writted here, last message:

  Validation and Select Item? [solved]
Posted by: El Forum - 07-13-2007, 08:04 PM - Forum: Archived Development & Programming - Replies (1)

I'm successfully using the validation class with text and textarea fields, but I can't get it to validate a <select> field. How do I do this? In this example, the menu is of all of the states and the values are all two-digit codes. I want to make it required and two digits only.

Controller Snippet

$rules['state_abbr'] = "exact_length[2]";

View Snippet
<select name="state_abbr" size="1">
<option value="">Select a State</option>
&lt;?php while (list($state_abbr, $state) = each($states)):?&gt;
<option value="&lt;?=$state_abbr;?&gt;" &lt;?=$this->validation->set_select('state_abbr', $state_abbr);?&gt; >&lt;?=$state;?&gt;</option>            
&lt;?php endwhile;?&gt;

It's in a form with other text fields and they are getting validated. This one select field is getting skipped. What's the trick? Thanks!

  default value paramater for get/post/cookie input class
Posted by: El Forum - 07-13-2007, 05:59 PM - Forum: Archived Libraries & Helpers - No Replies

I don't see any better outlet for this type of recommendation - I would love to contribute more to CI as my team and I have been using it recently on several projects.

Anyway, instead of sending a default value of false if a parameter is not set, I would recommend that it be a third option in the function.

For example:

function post($index = '', $xss_clean = FALSE, $default = FALSE)
        if ( ! isset($_POST[$index]))
            return $default;

Instead of returning false, I could assign a default value (which, by if not provided is false). I frequently need to assign something else, like a string or a non-zero integer.

I would recommend this for the get/post functions, if not the cookie/session functions as well.

  Combining EE and CI?
Posted by: El Forum - 07-13-2007, 05:23 PM - Forum: Archived General Discussion - Replies (2)

I'm going crazy. OK, admittedly that's a pretty short drive. Maybe even a putt. But, still....

Over the past three weeks or so I've bounced back and forth between CI and EE as the solution to a Web design/development project in which I'm engaged. Almost the instant I reach a conclusion, something causes me to rethink it.

I think I can finally articulate why I'm having the problem, so please bear with me. I'll try hard to be brief.

This is an existing site. It has two faces. One is a public face that has a fair amount of application-style interactivity associated with it (signups, logins, qualifications, validations, etc.). The other side is the member side which essentially features a lot of information that doesn't change over time but which needs to be easy for the non-technical marketing team to add to and modify. Aside from basic login and validation, the member site features relatively little executable PHP code at this moment. That may change but for now, that's the story.

So what I think I want is a CI site for the public side and an EE site for the member side. But I'm not at all sure that makes sense or is even feasible.

It occurred to me as I reflected on all of this this morning, that it would approach perfection if I could use EE as my CMS and have its templates sort of become my CI views. That may not be precisely the best way of describing what I mean, but it's as close as I can come.

Anyone have any interesting insights, guidance, ideas?

  Fix to PostgreSQL driver
Posted by: El Forum - 07-13-2007, 04:55 PM - Forum: Archived Development & Programming - No Replies

All parameters to the pg_connect() and pg_pconnect() PHP functions are optional, but the CI driver incorrectly assumes that they will all be defined as non-empty in the config file. As a result, it is not possible for CI to connect to a server via Unix domain sockets, which is the default configuration for PostgreSQL.

If "host=" is left out, it will default to Unix domain sockets instead of TCP/IP. If "user=" is left out, it will default to the user making the request. If "dbname=" is left out, it will also default to the user making the request. None of these default actions can be utilized in the current driver however, because it assumes that these values will be provided. Thus, if not provided, the connection string will look like "host= user= dbname=", which is invalid, and not the same as the desired empty connection string. Here is a patch against 1.5.4 to fix:

--- postgre_driver.php.orig     2007-07-12 06:56:22.000000000 -0500
+++ postgre_driver.php  2007-07-13 16:30:21.000000000 -0500
@@ -38,9 +38,13 @@
        function db_connect()
+               $database = ($this->database == '') ? '' : " dbname=".$this->database;
+               $hostname = ($this->hostname == '') ? '' : " host=".$this->hostname;
                $port = ($this->port == '') ? '' : " port=".$this->port;
+               $username = ($this->username == '') ? '' : " user=".$this->username;
+               $password = ($this->password == '') ? '' : " password=".$this->password;

-               return @pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
+               return @pg_connect($database.$hostname.$port.$username.$password);

        // --------------------------------------------------------------------
@@ -53,9 +57,13 @@
        function db_pconnect()
+               $database = ($this->database == '') ? '' : " dbname=".$this->database;
+               $hostname = ($this->hostname == '') ? '' : " host=".$this->hostname;
                $port = ($this->port == '') ? '' : " port=".$this->port;
-               return @pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
+               $username = ($this->username == '') ? '' : " user=".$this->username;
+               $password = ($this->password == '') ? '' : " password=".$this->password;
+               return @pg_pconnect($database.$hostname.$port.$username.$password);

        // --------------------------------------------------------------------
@@ -482,4 +490,4 @@


\ No newline at end of file

  1.5.4 - jpg upload no longer working
Posted by: El Forum - 07-13-2007, 04:13 PM - Forum: Archived Development & Programming - Replies (6)

I have a test CI application on my Windows development machine that utilizes the code from the CI user guide to perform image uploads. The script runs fine in 1.5.3, but no longer uploads a valid image in 1.5.4. The uploaded image appears to be the proper filesize, but is not viewable in Windows and is not considered a valid image when using the CI Image Resize functions.

When I copy the original 1.5.3 Upload.php file into 1.5.4 it works fine.

  DB Connection Issue
Posted by: El Forum - 07-13-2007, 03:01 PM - Forum: Archived Development & Programming - Replies (6)

Hi all... I got a DB connection problem..
this is my DB config

$active_group = "default";

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "root";
$db['default']['database'] = "test";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";

the autoload.php

$autoload['libraries'] = array('database');

And the Problem?? Blank Screen...
I install phpmyadmin.. and is working with the same params in the config...

any ideas??

ubuntu feisty, php5, mysql5


  Header and footer
Posted by: El Forum - 07-13-2007, 02:33 PM - Forum: Archived General Discussion - Replies (9)

[eluser]Anderson Mello[/eluser]
Hi guys,

I'm new in CI and I was thinking using one view with header information and another with footer. Then, with a custom method like $this->load->content('view_name'), both are included automatically. This way, I could insert all the metas, CSS and scripts tags as needed, avoiding editing too many views or including the header and footer view on each file.

Maybe the way I'm trying isn't the right one or maybe it can't be in that way... Smile

Anderson Mello

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