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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:00:29+00:00 2026-06-15T01:00:29+00:00

i am building a script using php to upload images in database but i

  • 0

i am building a script using php to upload images in database but i am stuck due to the error under:
when i open my page in browser following message shows to me:

Notice: Undefined index: image in C:\xampp\htdocs\12\index.php on line 10
please select a file

under is my script in initial form :

<html>
<body>
<form action="index.php" method="post" enctype="multipart/form-data">
File:<input type="file" name="image" /><input type="submit" value="upload" />
</form>
<?php
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("databaseimage") or die(mysql_error());
//files properties
echo $file = $_FILES["image"]["tmp_name"];
if(!isset($file))
echo'please select a file';
else{
    $image = $_FILES['image']['tmp_name'];
    }
?>
</body>
</html>
  • 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-06-15T01:00:30+00:00Added an answer on June 15, 2026 at 1:00 am

    Check, if there is an upload first (and therefore, $_FILES["image"] is existing at all):

    if (isset($_FILES["image"]))
    {
        $file = $_FILES["image"]["tmp_name"];
        if (!isset($file)) {
            echo 'please select a file';
        } else {
            $image = $_FILES['image']['tmp_name'];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to open and process ASCII files using PHP, but am having problems.
I'm building a MySQL movie posters/fan art database driven by a PHP script. I
I'm building a jQuery Mobile site, using PHP to interact with a MySQL database
I am building a simple PHP daemon script, using a php Daemon class provided
I am considering building a site using php, but there are several aspects of
I am using Java Script MVC framework for building a Web Application.. Now i
A php script is building the following (very complicated script that is too long
I'm building a PHP script that sends an email to people on their birthdays.
I'm building a Powershell script to manage distribution groups and contacts. But when I
we are building a PHP script that we need at work to create reports

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.