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



Search Forums

(Advanced Search)

Forum Statistics
» Members: 16,113
» Latest member: NhanThai5117
» Forum threads: 70,759
» Forum posts: 364,068

Full Statistics

Latest Threads
CodeIgniter 4.0 is here!
Forum: News & Discussion
43 minutes ago
» Replies: 85   » Views: 18,953
How to capture EventSourc...
Forum: General Help
4 hours ago
» Replies: 6   » Views: 130
Where are the migration c...
Forum: CodeIgniter 4 Support
4 hours ago
» Replies: 2   » Views: 39
Codeigniter Forum Integra...
Forum: Best Practices
5 hours ago
» Replies: 3   » Views: 226
Need Help with Modules
Forum: CodeIgniter 4 Support
5 hours ago
» Replies: 3   » Views: 80
Looking for opinions RE: ...
Forum: News & Discussion
5 hours ago
» Replies: 6   » Views: 6,409
Forum: Installation & Setup
5 hours ago
» Replies: 5   » Views: 158
CodeIgniter 2.2.0 Not com...
Forum: General Help
8 hours ago
» Replies: 0   » Views: 9
Is CodeIgniter 4 right fo...
Forum: Choosing CodeIgniter
8 hours ago
» Replies: 0   » Views: 26
CodeIgniter 4 Foundations...
Forum: Lounge
9 hours ago
» Replies: 4   » Views: 511

  Upload large files + progress bar
Posted by: El Forum - 07-23-2007, 06:04 PM - Forum: Archived General Discussion - Replies (40)

[eluser]Phil Sturgeon[/eluser]
Right, this has been gone over many times in various forums but none of the answer seem to cut it.

Im currently working on two systems, one similar to Newgrounds (upload flash games) and another similar to YouTube (upload various types of movie files ready to be converted) so I need to somehow restrict to types easily. I currently have no bloody idea how to upload one single (potentially large) file without getting a timeout either, and this has to be done on a server with no installation access and PHP 4.4.x

Can I use the file upload class or ftp class?

I dont care if I use Java applets, AJAX/Flash or what, but I need to work out something shiny within the next few days or im toast! Anyone?

Edit: http://encodable.com/uploaddemo/ or http://store.masrizal.com/product/custom...mple_2.phplooks awesome, anyone know of something like this for PHP that is free?

  What does the CI instance store?
Posted by: El Forum - 07-23-2007, 05:33 PM - Forum: Archived Development & Programming - Replies (3)

I've noticed a lot of code from users grabs an instance of the CI object to make calls like $this->CI->config-item(...), or session stuff, etc...

Question 1: What is the point of doing the above, when the user guide advocates loading a library like so:


Isn't that what it's for? I see it so often it seems wrong to do it the way the manual says.

Question 2: What kind of stuff is stored in the CI instance? I did a print_r on it, but so much stuff printed out I couldn't really tell what was going on.

Any help is appreciated, thanks.

  Capturing multiple select form input
Posted by: El Forum - 07-23-2007, 04:43 PM - Forum: Archived Development & Programming - Replies (5)

Please help.

I've got a form that looks like this:

<form action="http://test.dev/admin/document_assign_update" method="post">
<input type="hidden" name="document_id" value="1" />
<select type="text" name="username[]" multiple="multiple" size="4">
   <option value="user1"><br />classname1</option>
   <option value="user2"><br />classname2</option>
   <option value="user3"><br />classname3</option>
&lt;input type="submit" value="submit" /&gt;

How do I capture the data from the multiple select?

I've put something as simple as this in the controller just to see what it outputs (not using any views at the moment):

function document_assign_update() {

When I don't select anything from the drop down and submit I get this output ...

Array ( [document_id] => 1 )

... which is fine, but then if I select an option from the drop down and then submit I get an error message related to the database:

An Error Was Encountered

Error Number: 1054

Unknown column 'Array' in 'where clause'

SELECT username, role FROM auth WHERE username = Array AND password = 'd41d8cd98f00b204e9800998ecf8427e'

why am I getting this error when I'm quite simply asking for the post output with print_r($_POST); ???

Can someone see what I'm doing wrong?

  How download images?
Posted by: El Forum - 07-23-2007, 04:40 PM - Forum: Archived Development & Programming - Replies (3)

I'm downloading images from the web onto my server.
Can one do this in CI?

1. the user types in some search terms,
2. we do the search on Google images,
3. we show the user the thumbnails,
4. the user clicks on an image and we download it from the web onto our local filesystem (it becomes the user's avatar.)

...I'm not sure how to do #4 in CI


  Call to undefined function anchor( ) when stepping through the tutorial.
Posted by: El Forum - 07-23-2007, 02:48 PM - Forum: Archived Development & Programming - Replies (4)

[eluser]Chris (from L.C.)[/eluser]
I'm steeping through the video tutorial, and I'm stuck on the adding the comment form helper. I've correctly added the helpers in blog.php, and the anchor call, but I'm getting this error:

Call to undefined function anchor() in /home/quickgig/public_html/system/application/views/blog_view.php on line 17

I've left it up at http://www.quickgig.com/blog, along with the

&lt;?php phpinfo(); ?&gt;
tag incase there is something there helpful.

Here's the blog.php code:

class Blog extends Controller {

function blog()

function index()
  $data['title'] = "Blog Title";
  $data['heading'] = "Blog Heading";
  $data['query'] = $this->db->get('entries');
  $this->load->view('blog_view', $data);

and the blog_view.php code:

&lt;title&gt;&lt;?=$title; ?&gt;&lt;/title&gt;

<h1>&lt;?=$heading; ?&gt;</h1>

&lt;?php phpinfo(); ?&gt;

&lt;?php foreach($query->result() as $row): ?&gt;


<p>&lt;?=anchor('blog/comments', 'Comments');?&gt;</p>

&lt;?php endforeach; ?&gt;



  new thread in php
Posted by: El Forum - 07-23-2007, 01:00 PM - Forum: Archived Development & Programming - Replies (1)


My background is in Java so my terminology may be a little off. Is there a way to create a new Thread in php. Bascially, I need to execute some SQL code, asynchronously. Any suggestions?

  Generic Models & Views vs Bespoke Models and Views?
Posted by: El Forum - 07-23-2007, 12:09 PM - Forum: Archived Development & Programming - Replies (3)


1 - Generic Model vs Multiple Bespoke Models

For the particular application I am creating, all database queries are completed via stored procedures.

So could you therefore have one generic model class, and pass to it from the controller, the name of the procedure to execute, and the ID or names of the fields to return (if a select).


$this->generic_model->add(sp_xxx_ins, $v1, $v2, $v3);
(= 'exec sp_xxx_ins $v1, $v2, $v3')

$this->generic_model->add(sp_xxx_del, $id);
(= 'exec sp_xxx_del $id')

$this->generic_model->add(sp_xxx_sel, $id, $name, $desc, $etc);
(= 'exec sp_xxx_sel $id' and then return the requested fields.)

Syntax may not be correct or the best way for passing the parameters, I haven't checked, but the idea is the same..

Is this a good way? It will cut out a lot of duplicated code. But is it generally best to have a 'model per table'?

2 - Generic View Template vs Multiple Bespoke Views

Different views - what is better:

1) Create multiple bespoke views with info such as forms, table headings, titles etc hard coded in them.


2) A single generic view template. Build up the dynamic data in the controller, i.e. build a form with the form helper, or create an array of table headings - and then pass this data into a generic view template?

What I am thinking is with the above ways you could have a few generic View templates (i.e. a generic table view, a generic form view, etc) and a single/or few generic Model. But then of course the controller may get quite large? Maybe the controller is doing some of the work that should be handled by the View ???

Please can someone advise the best direction to take? I want to make sure I am following the MVC structure as conventionally as possible.

Thanks Smile


  Sharing liibraries with multiple applications
Posted by: El Forum - 07-23-2007, 09:52 AM - Forum: Archived Development & Programming - Replies (5)

I am using multiple applications with Code Igniter (with this method).

My CI directory looks like this one :

# application1
* index.php
* config
* [...]
* views

# application2
* index.php
* config
* [...]
* views

# system
# user_guide

I am looking for a way to share a library between all my applications of Code Igniter.
Is it possible ?

  Showing currently online users...
Posted by: El Forum - 07-23-2007, 09:33 AM - Forum: Archived Development & Programming - Replies (3)

Has anyone here written code that will output the current amount of users on the site (in say, the last minute or so).

I thought about using sessions but they seem to be wildly inaccurate. IP's? Ideas?


  showing code
Posted by: El Forum - 07-23-2007, 08:41 AM - Forum: Archived Development & Programming - Replies (14)

Hi all,

I'm making an Code Igniter help site for my work, i'm the first who's working/testing codeigniter and want to make some code examples and stuff..
(also makes me more experienced with CI)
now is my question..
how do i print out code like this
(and i mean what you see the php code with colors and all)

&lt;?php echo 'example code'; ?&gt;
Is there an helper/librarie/class/plugin or something for this?

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