Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6907439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:26:06+00:00 2026-05-27T08:26:06+00:00

first please be gentle im a really big begginer. Ok im making a real

  • 0

first please be gentle im a really big begginer.

Ok im making a real estate site and i really have no clue, i tried several things but i cant make it work.

My problem is when i add a new real estate to the site, the system generates an unique 7 characters long numeric string and inserts it in to the database.

So when i upload an image i would like that the system creates a folder named with this unique 7 characters long numeric string and place the images there.

here is my controller

<?php

class ihirdet extends CI_Controller
    {
        function index()
            {
                $this->load->view("header");

                $this->form_validation->set_rules('cim', 'Cím', 'min_length[10]|max_length[100]');
                $this->form_validation->set_rules('htipus', 'Hirdetés típusa', 'required');
                $this->form_validation->set_rules('itipus', 'Ingatlan típusa', 'required');
                $this->form_validation->set_rules('iallapot', 'Ingatlan állapota', 'required');
                $this->form_validation->set_rules('jaras', 'Járás', 'required');
                $this->form_validation->set_rules('telepules', 'Telepules', 'required');
                $this->form_validation->set_rules('utca', 'Utca', 'required');
                $this->form_validation->set_rules('hazszam', 'Házszám', 'required|numeric');
                $this->form_validation->set_rules('emelet', 'Emelet', 'numeric');
                $this->form_validation->set_rules('telekterulet', 'Telekterület', 'numeric');
                $this->form_validation->set_rules('alapterulet', 'Alapterület', 'numeric');
                $this->form_validation->set_rules('ingatlanar', 'Ingatlan ára', 'required|numeric');
                $this->form_validation->set_rules('penznem', 'Pénznem', 'required');
                $this->form_validation->set_rules('epitesev', 'Építés éve', 'numeric');
                $this->form_validation->set_rules('szoba', 'Szoba', 'numeric');
                $this->form_validation->set_rules('felszoba', 'Félszoba', 'numeric');
                $this->form_validation->set_rules('futes', 'Fűtés', 'required');
                //$this->form_validation->set_rules('userfile', 'Kép', 'callback_kep_ellenor');
                $this->load->model('hirdetes_model');

                if($this->form_validation->run() !== FAlSE)
                {
                    $this->hirdetes_model->kuld();


                //  redirect(base_url() . 'elado/adatlap/' . $this->input->post('azonosito'));
                } else {
                    $this->load->model('hirdetes_model');
                    $data['felh_inf'] = $this->hirdetes_model->felh_info();
                    $this->load->view("ihirdet_sablon", $data);
                }
                    $this->load->view("footer");
            }

        }

?>

I was testing, and i was able to upload only one image and create the folder.

My question is, how can i implant a multi imageupload in to my index function, with createing the folder.

And a validation so only create the folder and upload the images in it when the image input has a value, but if the user didnt fill out the form correctly, but the image is fine still dont create the folder and dont upload the image.

Please dont misunderstand me, i dont want anybody to write the codes for me, i just want a more expreienced developer to share his thougts how would he make it, no codes just share the idea, and i will try to make it by my self.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:26:06+00:00Added an answer on May 27, 2026 at 8:26 am

    You could try something like this:

    function tester($yourUniqueId){
    
     $this->load->library('upload'); 
    
     for($i=0; $i<count($_FILES); $i++)
     {
    
       $_FILES['userfile']['name']    = $_FILES['filename']['name'][$i];
       $_FILES['userfile']['type']    = $_FILES['filename']['type'][$i];
       $_FILES['userfile']['tmp_name'] = $_FILES['filename']['tmp_name'][$i];
       $_FILES['userfile']['error']       = $_FILES['filename']['error'][$i];
       $_FILES['userfile']['size']    = $_FILES['filename']['size'][$i];
    
       $config['file_name']     = $yourUniqueId.'/test_'.$i;
       $config['upload_path']   = './public/uploads/';
       $config['allowed_types'] = 'jpg|jpeg|gif|png';
       $config['max_size']      = '0';
       $config['overwrite']     = FALSE;
    
      $this->upload->initialize($config);
    
      if($this->upload->do_upload())
      {
        $error += 0;
      }else{
        $error += 1;
      }
     }
    
     if($error > 0){ return FALSE; }else{ return TRUE; }
    
    }
    
    

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I'm new to Java, so please be gentle. I have a JFrame
first time poster. Please be gentle. This topic may be similar to several other
This is my first question her so please be gentle: I have followig animation
First off, I'm a real beginer at C# so please be gentle. I'm trying
This is my first time asking a question, please be gentle! I have a
This is my first post on StackOverflow, so please be gentle... I have some
First time Stack Overflow poster. Please bear with me! :) I have a set
This is my first post, so please be gentle. I've been playing around with
first question to StackOverflow, please be gentle. I am trying to find the equation
First question on SOF, please be gentle if this may be a stupid question.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.