Welcome Guest, Not a member yet? Register   Sign In
  CI only support one level sub-folders?
Posted by: El Forum - 10-26-2007, 09:14 PM - Replies (2)

[eluser]jackIgniter[/eluser]
I have a admin sub folder in my CI controllers folder. And it works fine until I added one more folder above my admin folder.

For example:

Code:
http://localhost/mysite/index.php/folder/admin_folder/controllerName/method

Then it does not work.

But if I delete the folder that is above my admin folder, like:

Code:
http://localhost/mysite/index.php/admin_folder/controllerName/method

It will work again.

It seems CI only support one level sub-folder in controller. Am I right?


  Simple Image Uploader
Posted by: El Forum - 10-26-2007, 05:53 PM - No Replies

[eluser]lszanto[/eluser]
Hey, I've been fiddling round with CodeIgniter for around a week now and am starting to get the hang of it and realizing how powerful and helpful it is, this is my first project that i've launched and it is just a simple image uploader.

Feedback would be great.

http://lszanto.hosttds.com/uploader/


  query problem
Posted by: El Forum - 10-26-2007, 05:47 PM - Replies (1)

[eluser]MMCCQQ[/eluser]
hi

i workin in a friend system. i got this problem
i got two table SQL

friends_add - id - id_user - friends - added

member - id - username - avastar

so i want get de Request list of a X id. and get de Username and avastar with his id.

i do this;

CONTROLLER
$id = my id ; ex : 1

Code:
$this->db->where('friends',$id);
        $qery = $this->db->get('friends_add');
        if($qery->num_rows() > 0)
        {
            
            foreach ($qery->result() as $row){
                $this->db->where('id',$row->id_user);
            $query = $this->db->get('member');
            }
                $side['friends'] = $query->result();

this code just gimme one friend request but i got two request. i dont know what happed!
VIEW
Quote:<?php foreach($friends as $row2):?>
<img width="60" height="60" src="/&lt;?=$row2->avastar;?&gt;">
&lt;?=$row2->username;?&gt;


  Accounting Systems
Posted by: El Forum - 10-26-2007, 04:33 PM - Replies (9)

[eluser]kevinprince[/eluser]
So, this evening I was trying to cut the development time of a mediumish CRM system I'm building for a sport organization. Which in future will be open sourced and I cant believe how badly done or overtly complex people are making simple accounting systems.

Im probably going to just write it myself, however has anyone got any ideas on decent simple ledger apps which use PHP and MYSQL?

If not has anyone done any basic accounts systems and would like to share any advice on creating one, as while im not clueless (business student turned programmer), It would be great to get ideas.


  creating libraries in subdirectories
Posted by: El Forum - 10-26-2007, 03:52 PM - No Replies

[eluser]Majd Taby[/eluser]
Hey, I want to create a new validation library, MY_Validation, it works, but only if i put the file in application/libraries/ I need to be able to put it in application/backend/libraries.

I looked at system/codeigniter/Common.php and it seems to accomodate for it (using APPPATH, which includes the subdirectory), but it just doesn't work. Here's the error:

Fatal error: Cannot redeclare class CI_Validation in /Users/majd/Sites/portal_wc/system/libraries/Validation.php on line 43

here's how the code looks:

Code:
class MY_Validation extends CI_Validation{
    
    function MY_Validation()
    {    
        parent::CI_Validation();
    }


  Scaffolding without mod_rewrite
Posted by: El Forum - 10-26-2007, 03:26 PM - No Replies

[eluser]datdesignguy[/eluser]
Hi,

I'm currently developing my first CI application, and one of the limitations I'm working with is that our office is running IIS 6, and the IT guys won't let me install an IIS equivalent to apache's mod_rewrite.

So, I've got my database all set up here, and I configured CI to run in querystring mode, but now I'm wondering how the heck I trigger scaffolding?

I tried http://example.com?c=scaffolded_controller&scaffold;_trigger

where 'scaffold_trigger' is the trigger word I set in my routes.php file but nothing happened.

Is there currently anyway to trigger scaffolding when .htacces/URL rewriting is not available?

Thanks,

Greg J


  uploading pdf file is giving me fits of numb
Posted by: El Forum - 10-26-2007, 03:06 PM - No Replies

[eluser]FuzzyJared[/eluser]
I am able to upload all necessary files for my application with the exception of pdf files. I have gone through a couple of posts about this. One of which was posted just over a year ago.

Long story short when I echo out the $this->file_type within the Upload.php I get the following -
application/unknown

Which is obviously a problem as I can't exactly allow application/unkown

The weird part is this happens using Firefox 2.0.0.08 but not in safari on a mac. I have not validated yet on a pc.

I should also mention that Apache 2 and PHP 5.2.3

Tanx in advance


  Will CI Let Me Redirect to another Controller?
Posted by: El Forum - 10-26-2007, 03:05 PM - Replies (4)

[eluser]scottelundgren[/eluser]
I'm writing an application that requires authentication & authorization. I've written a controller that handles these requirements but now I face a dilemma and need some architectural advice.

Once my "login" controller performs the authentication and authorization routines I'd like to redirect my user into another controller based on their role. What I envision is that these "role controllors" would then load the role models, fetch data and perform the view:

Code:
if ($this->_authenticate() && $this->_authorize()) {
  if ($this->session->userdata('role') == "instructor") {
    $this->redirect('instructor');
  } elseif ($this->session->userdata('role') == "administrator") {
    $this->redirect('administrator')
  } else {
    $data['error'] = "Could not authorize ".$this->session->userdata('username');
    $this->load->view('login_authorize', $data);
  }
} else {
  &lt;!-- snip load the login form snip --&gt;
}

I'm having trouble with my redirects firing. Is this not the "CI" way to accomplish this? what's the better way of making sure they user is logged in and shuffling them off to their respective task screen. It seems like I'm clouding my "login" controller if I write 2 functions for each task to seperately load the models & views for my seperate roles.


  Active Record select question
Posted by: El Forum - 10-26-2007, 02:08 PM - Replies (3)

[eluser]Eric Barnes[/eluser]
Hi,

I have this query:

Code:
SELECT * FROM kb_articles WHERE a_display = 'Y' AND a_id IN ( 1,2 )

I am trying to use something similar with active record and it appears this isn't possible because it always comes out as:

Code:
SELECT * FROM kb_articles WHERE a_display = 'Y' AND a_id IN '1,2'

My ci code looks like this:
Code:
foreach ($query->result() as $row)
{
    $aID.=$row->article_id.',';
}
$aID = rtrim($aID, ', ');
$this->db->from('articles');
$this->db->where('a_display', 'Y');
$this->db->where('a_id IN', $aID);

Does any one have any advice on a work around or maybe an easier way to set this up?


  Protecting Web-Accessible Directory and Subcontents
Posted by: El Forum - 10-26-2007, 01:17 PM - Replies (4)

[eluser]skfriese[/eluser]
Is there any way to restrict access to the content within a web-accessible folder using the login details contained within a PHP session? Please read scenario below before replying. ;-)

I have an existing CodeIgniter application that happens to serve up web accessible content. Users are required to login to view the content, and their sessions are managed through DB-based PHP sessions. This all works fine, for the most part. However, it is still possible to access the web-accessible content directly by bypassing the CodeIgnitor application altogether and entering the URL to the content within the browser's address bar.

Now, the reason why this is now a problem is that there was never a requirement to "lock down" the content. The application merely tracks the user's progress through the content using AJAX if the user is logged into the application. No such progress is tracked if accessed "outside of the application". No big deal, but the client wishes to lock this content down now, and only allow those logged into the system to access it.

Being familiar with htaccess/htpasswd, I am able to restrict access to main content folder, but then the users must login again to launch the content. Thus my question above. Is there any way to "set" the $_SERVER['PHP_AUTH_USER'] or $_SERVER['PHP_AUTH_PW'] through PHP, so that I can set the HTTP authentication criteria when the user logs into the application? I'm also familiar with passing requests to the content using a "proxy" PHP script and authenticating that way instead, but that is not an option with this type of content as it is structured.

Any direction is greatly appreciated. I've attempted some serious Google-Fu over the past couple of days with no luck so far. :-S


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

Username
  

Password
  





Latest Threads
Heads up for users using ...
by davis.lasis
5 hours ago
curl + response body
by okatse
6 hours ago
Tool bar not showing
by grimpirate
7 hours ago
The Hidden Cost of “Innov...
by fcoder
Today, 03:11 AM
tool bar not showing
by InsiteFX
Yesterday, 09:09 PM
Validation does not appea...
by grimpirate
Yesterday, 01:55 PM
Block IP addresses of bad...
by grimpirate
Yesterday, 01:47 PM
Override Router
by grimpirate
Yesterday, 01:30 PM
CodeIgniter.com - Report ...
by Vikas Mehta
06-30-2025, 10:30 AM
best way to store tokens ...
by ahallrod
06-30-2025, 10:03 AM

Forum Statistics
» Members: 154,375
» Latest member: atsaigonriversides
» Forum threads: 78,436
» Forum posts: 379,709

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB