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 927963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:56:04+00:00 2026-05-15T19:56:04+00:00

Getting Undefined index: filename error in the below image upload php code. Is there

  • 0

Getting Undefined index: filename error in the below image upload php code. Is there any problem in the below code?

<div id="content">
    <form class="wufoo" action=<?php echo (BASE_PATH. 'admin/addbusinessdetail'); ?> method="post">
            <input type="hidden" name="maxSize" value="9999999999" />
            <input type="hidden" name="maxW" value="200" />
            <input type="hidden" name="fullPath" value="<?php echo (BASE_PATH. 'public/img/uploads/'); ?>" />
            <input type="hidden" name="relPath" value="<?php echo (BASE_PATH. 'public/img/uploads/'); ?>" />
            <input type="hidden" name="colorR" value="255" />
            <input type="hidden" name="colorG" value="255" />
            <input type="hidden" name="colorB" value="255" />
            <input type="hidden" name="maxH" value="300" />           
        <ul>
             <li>
        <label class="desc">Business Type</label>
            <br />
                    <div>
                        <select class="field select" name="ddltype" style="width:300px; height: 30px;">
                            <?php
                                $types = $this->_data;
                                foreach ($types as  $value) {
                                   foreach($value as $innvalue){
                                         $businessname[] = $innvalue;
                                        }
                                        echo('<option value="'.$businessname[0].'">'.$businessname[1].'</option>');
                                        unset($businessname);
                                }
                            ?>
                        </select>
                    </div>
        </li>
        <li>
        <label class="desc">Business Detail <span class="req">*</span></label>
                    <br />
            <div>
                        <input type="text" class="field text" name="businessname" style="width: 300px; height: 20px;" />
            </div>
        </li>
            <li>
        <label class="desc">Business Website <span class="req">*</span></label>
                    <br />
            <div>
                        <input type="text" class="field text" name="website" style="width: 300px; height: 20px;" />
            </div>
        </li>
            <li>
        <label class="desc">Business Email <span class="req">*</span></label>
                    <br />
            <div>
                        <input type="text" class="field text" name="email" style="width: 300px; height: 20px;" />
            </div>
        </li>
            <li>
        <label class="desc">Business Image <span class="req">*</span></label>
                    <br />
            <div>
                        <input type="file" name="filename" />
            </div>
        </li>
            <li>
        <label class="desc">Address <span class="req">*</span></label>
                    <br />
            <div>
                        <textarea name="address" cols="50" rows="8" ></textarea>
            </div>
        </li>
        <li class="buttons">
            <input class="submit" type="submit" value="Save" /> <input class="submit" type="button" value="Cancel" onClick="history.back()" />
        </li>
        </ul>

    </form>

addbusinessdetail controller

    function addbusinessdetail()
            {
              print_r($_FILES['filename']);
              $this->Admin->addbusinessdetail();
              $this->businessdetails(0,0);
            }
  • 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-15T19:56:04+00:00Added an answer on May 15, 2026 at 7:56 pm

    add this to your form tag:

    enctype="multipart/form-data" 
    

    If you’re doing a file upload, you need this form attribute so the web server knows to expect file data.Here’s some more info on file uploads: http://www.tizag.com/phpT/fileupload.php

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

Sidebar

Related Questions

I am getting JQUERY undefined error. Do you have any idea (code below). <%@
I'm getting an undefined index error in this code: function get_userdata() { global $db;
edit i am not getting the error undefined index 'time' any longer. Now i
I keep getting an Notice: Undefined index: did error with this query, and I'm
Why am I getting an undefined label error in following code? (I am leaving
I am getting an undefined index error message on server side when i am
why I am getting undefined index error ? if(isset($arr[val][3]) { $res =isset($arr[val][3][body]) ? $arr[val][3][body]
I am getting an Undefined index error when submitting a form with an un-checked
I'm getting Notice: Undefined index: HTTP_X_FORWARDED_FOR in the Function below: function _ip( ) {
I am getting the undefined index error as I come for the first time

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.