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



Search Forums

(Advanced Search)

Forum Statistics
» Members: 18,042
» Latest member: tyler-m
» Forum threads: 71,544
» Forum posts: 367,351

Full Statistics

Latest Threads
How to multiupload images...
Forum: General Help
59 minutes ago
» Replies: 1   » Views: 19
Starting a CI 4 project: ...
Forum: CodeIgniter 4 Discussion
1 hour ago
» Replies: 11   » Views: 765
Routing and pagination CI...
Forum: General Help
5 hours ago
» Replies: 0   » Views: 30
Create CI4 project in sub...
Forum: CodeIgniter 4 Discussion
6 hours ago
» Replies: 6   » Views: 506
Problem when upload to sh...
Forum: CodeIgniter 4 Support
6 hours ago
» Replies: 0   » Views: 26
Using Websockets in codei...
Forum: Libraries & Helpers
6 hours ago
» Replies: 2   » Views: 331
Extract data from CSV fil...
Forum: CodeIgniter 4 Support
7 hours ago
» Replies: 0   » Views: 18
Database Connection Error...
Forum: General Help
9 hours ago
» Replies: 0   » Views: 13
DB failover settings in ....
Forum: Installation & Setup
9 hours ago
» Replies: 2   » Views: 81
Forum: CodeIgniter 4 Support
Yesterday, 04:06 PM
» Replies: 1   » Views: 58

  validating unkown number of related fields
Posted by: El Forum - 10-05-2007, 08:28 PM - Forum: Archived General Discussion - Replies (6)

Hi. I have a set of related fields that can be created dynamically, via javascript, by the user. I'm not sure how to use CI's validation facilities without knowing the number of fields ahead of time.

  Pros and Cons: Requiring Separate Login for Forum?
Posted by: El Forum - 10-05-2007, 05:53 PM - Forum: Archived General Discussion - Replies (15)

I may want my site to have a forum where people can discuss the site. At first glance, it seems like the right thing to do, is to find a way so that the same username/password works on the main site, and on the forum as well.

OTOH, the biggest problem with forums, is spam. I've got a forum where people discuss general blogging subjects unrelated to any particular CMS (forum4bloggers.com), and it was almost destroyed by spammers, even though only registered users can post, and the registration system uses captcha. It got so inundated with spam that I had to shut it down for a while. I only got it working again by requiring every new registrant, to email me personally, requesting registration approval.

So there need to be anti-spam measures on a forum, that don't need to be on my main site. And of course, there's also the hassle of integrating the login for the site, with the login for the forum.

Would it be a big mistake to require users to have a username/password on the forum, that is different from the username/password they have on the main site?

Thanks in advance to all for any opinions/thoughts/info.

  Pagination inquiry for this n00b!
Posted by: El Forum - 10-05-2007, 04:31 PM - Forum: Archived Development & Programming - Replies (5)

Yay, I'm officially labeling myself a n00b. :-)

I appreciate the time anyone who enters a thread with 'paginatin' in the topic as well. :-)

Either way, here it is plain and simple. My controller's constructor looks like this:

function inventory()
        $this->load->model('Autodb_model', 'autodb');

and within the controller, is my method for displaying an inventory:

function client_side()
        // client side inventory view.
        // This is VERY similar to the live() method
        // which retrieves the data we need for current
        // live vehicles. Let's grab this data.
        $data['opts'] = $this->autodb->get_vehicle_options();
        // config params for pagination
        $config['base_url'] = 'http://'.base_url().'/inventory/client_side';
        $config['total_rows'] = count($data['opts']);
        $config['per_page'] = '10';
        $config['uri_segment'] = 2;
        $this->load->view('client/inventory_view', $data);


Then within my view I execute the following code:


                &lt;!--<h5><a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">Next</a> <a href="#">>></a></h5>--&gt;
                &lt;?= $this->pagination->create_links() ?&gt;

Any idea why the pagination class isn't properly being loaded?

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Inventory::$pagination

Filename: controllers/inventory.php

Line Number: 67

Thanks for looking, folks!

- sf

  Rick made me buy a MacBook Pro :p
Posted by: El Forum - 10-05-2007, 01:24 PM - Forum: Archived Development & Programming - Replies (7)

So i've spent what a year and a half at least developing in CI, am travelling and decided to go Mac (Ok so the personal tour through cupertino helped), so I could have decent, native, local development on my laptop.

Have installed macports, port installed php5, mysql5... set up hosts etc. etc etc.

I can connect to the mysql server in navicat, 104% sure I have the connection details right in CI/php.

Problem: Cant seem to connect, and in my 'nix experience that's because PHP/MySQL arent playing nicely.

I've searched previous threads looking for your very helpful install instructions but something ain't giving.

Who's got a "Oh you just do this and it'll all work" for me? Tongue


  Stupid php question
Posted by: El Forum - 10-05-2007, 12:22 PM - Forum: Archived Development & Programming - Replies (6)

[eluser]Aaron L.[/eluser]
Hi guys,

I am trying to write an IF statement which redirects users to the login if they are not one of two types of users (based on session info).

Here is what I have:

$user_type = $this->session->userdata('user_type');

if($user_type != "teacher" || $user_type != "school_admin")

Why is it that this doesn't work? If the user is a teacher, it skips the redirect but if the user is a school_admin, it sends them to login again.

A little help?

  Multiple file upload not working...
Posted by: El Forum - 10-05-2007, 10:06 AM - Forum: Archived Development & Programming - Replies (5)

Hey guys I'm having trouble uploading multiple files. I use the examples given by other CI gurus here but it doesn't seem to work. Here's my code...


<p>&lt;input type="file" name="userfile[]" SIZE="70" class='inputProjBox'/&gt;&lt;?php echo anchor('','Add',array('class'=>'addInputFields')); ?&gt;</p>

I run a foreach loop cuz I don't know how many files the user is going to upload. Fortunately it runs if I upload the first file. But the subsequent files no banana..
function attachSprocketFile()
   $config['upload_path'] = './sprocket_files/';
   $config['allowed_types'] = 'gif|jpg|png';
   $config['max_size'] = '2048';
   $config['max_width'] = '1024';
   $config['max_height'] = '768';
    $build = array();
    for ($i=0; $i < count($_FILES['userfile']['name']); $i++) {
     $build['part' . $i]['type']   = $_FILES['userfile']['type'][$i];
     $build['part' . $i]['name']   = $_FILES['userfile']['name'][$i];
     $build['part' . $i]['type']   = $_FILES['userfile']['type'][$i];
     $build['part' . $i]['tmp_name']  = $_FILES['userfile']['tmp_name'][$i];
     $build['part' . $i]['error']   = $_FILES['userfile']['error'][$i];
     $build['part' . $i]['size']   = $_FILES['userfile']['size'][$i];
    $_FILES = $build;
  foreach($_FILES as $key=>$value){
     $datas['error'] = $this->upload->display_errors();
     $datas['listings'] = $this->db->get('tag_listings');
     $data['title'] = "Sprocket Fish: Upload Files";
     $data['header'] = $this->load->view('snippets/header.php','',TRUE);
     $data['content'] = $this->load->view('app/sprocket/upload_form.php',$datas,TRUE);
     $data['footer'] = $this->load->view('snippets/footer.php','',TRUE);

    } else {
     $file = $this->upload->data();
     $config['image_library'] = 'GD';
     $config['source_image'] = './sprocket_files/'.$file['file_name'];
     $config['new_image'] = './sprocket_files_thumbs/'.$file['file_name'];
     $config['create_thumb'] = FALSE;
     $config['maintain_ratio'] = TRUE;
     $config['width'] = 75;
     $config['height'] = 50;
     $config2['image_library'] = 'GD';
     $config2['source_image'] = './sprocket_files/'.$file['file_name'];
     $config2['new_image'] = './sprocket_files_resized/'.$file['file_name'];
     $config2['create_thumb'] = FALSE;
     $config2['maintain_ratio'] = TRUE;
     $config2['width'] = 367;
     $config2['height'] = 287;


  create my own library with php 4 and get_instance
Posted by: El Forum - 10-05-2007, 08:18 AM - Forum: Archived Development & Programming - Replies (1)

Hi all!
I read up on creating library in user documentation
and about the get_instance() function i founded this :

Quote:Also, please note: If you are running PHP 4 it's usually best to avoid calling get_instance() from within your class constructors. PHP 4 has trouble referencing the CI super object within application constructors since objects do not exist until the class is fully instantiated.

so.. if i need to use helper in my library what i have to do?? where i have to define the CI object reference ??

Thank you for your help

  ODBC connection Access
Posted by: El Forum - 10-05-2007, 06:22 AM - Forum: Archived Development & Programming - No Replies


Can somebody tell me whats going wrong here? Apart from the usage off Access Smile

I'm trying to connect to a Access database, but CI only comes with this error: Unable to connect to your database server using the provided settings.

Database setting I'm using at the moment:
$db['default']['hostname'] = "DRIVER=Microsoft Access Driver (*.mdb);SYSTEM=;DBQ=/folder/db.mdb";
$db['default']['username'] = "xx";
$db['default']['password'] = "xx";
$db['default']['database'] = "db.mdb";
$db['default']['dbdriver'] = "odbc";
$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'] = "";

Many thanks in advance!

  DB insert error
Posted by: El Forum - 10-05-2007, 01:23 AM - Forum: Archived Development & Programming - Replies (3)

I have the following simple code:

$data1 = array(
                    'product_id' => $product_id,
                      'image' => $img,
                    'thumb' => $thumb,
                    'order' => $i);  
                    $this->db->insert('images', $data1);

which is put in a loop and $i is the number. But when i run it it produces:

Quote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order) VALUES ('95', '95_0.jpg', '95_0_thumb.jpg', 0)' at line 1

INSERT INTO images (product_id, image, thumb, order) VALUES ('95', '95_0.jpg', '95_0_thumb.jpg', 0)

Why is that? I can run other insert queries on the server but why this one fails as all seems to be normal. BTW i also tried putting unset($data1) at the end of the loop but its not helping. Thanks!

  encryption algorithm
Posted by: El Forum - 10-05-2007, 12:26 AM - Forum: Archived Development & Programming - No Replies

Hello all;

I'm currently working on encryption algorithm for small embedded systems.....I had selected a combination of RSA and Blowfish.....where RSA is used for the session key encryption...

Could any body suggest a method of transferring the public keys to the recipients with authentication without using the CA certification or PKI....as its dealing with embedded systems and having a third party to monitor the public key transfer is a major area of concern..

Any help in this regard will be greatly appreciated..

Thanking you'll in advance..


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