SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Undefined index: image in E:\xxx

    hi,
    new here.
    i get an error: Undefined index: image in E:\xxx...
    the code seems pretty straight forward to me. Please help me.

    <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());
    $file= $_FILES['image']['tmp_name'];
    ?>

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,892
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    change
    PHP Code:
    $file$_FILES['image']['tmp_name']; 
    to
    PHP Code:
    if (isset($_FILES['image']['tmp_name'])) {
      
    $file$_FILES['image']['tmp_name'];

    isset

    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •