Web Analytics Made Easy -
StatCounter More errors - CodingForum

Announcement

Collapse
No announcement yet.

More errors

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • More errors

    hi guys.. 1st of all i created this new thread because my old post wasnt presise enough + i have made changes

    here is the error msg i get ..


    Warning: Unable to create '/usr/pic/6584/sitamitop_01_1.gif': No such file or directory in /var/www/html/uppic.php on line 14

    Warning: Unable to move '/var/www/temp/php4HbbKm' to '/usr/pic/6584/sitamitop_01_1.gif' in /var/www/html/uppic.php on line 14
    Unknown table 'top_01_1' in field list

    EDIT :: the files are not getting uploaded to the temp dir even though the permissions are correct & it exists

    the code below is the new code..
    PHP Code:
    <?php
    session_start
    ();
    $MM_RestrictGoTo "index.php";
    if (!(isset(
    $_SESSION['MM_Username']))){
    header("Location: "$MM_restrictGoTo); 
    }
    require_once(
    'Connections/database.php');
    $file_dir "/usr/pic/6584"// directory where you want file to be uploaded to
    $imgusr $_SESSION['MM_Username'];
    foreach( 
    $_FILES as $file_name => $file_array ) {
    if (
    substr($file_array['type'], 05)=="image") {
    if ( 
    is_uploaded_file$file_array['tmp_name'] ) ) {
    move_uploaded_file$file_array['tmp_name'], "$file_dir/".$imgusr.$file_array['name']);
    mysql_select_db($database_database$database);
    $query_imgupload "INSERT INTO files (fid, username, file_name, file_type, file_size) VALUES ('', '$imgusr', {$file_array['name']}{$file_array['type']}{$file_array['size']})";
    $imgupload mysql_query($query_imgupload$database) or die(mysql_error());
    $row_imgupload mysql_fetch_assoc($imgupload);
    $totalRows_imgupload mysql_num_rows($imgupload);
    }
    }
    }
    ?>
    PHP Code:
    The form field

           
    <form enctype="multipart/form-data" method="post">
    <
    input type="hidden" name="MAX_FILE_SIZE" value="3000000">
    <
    input name="fupload" type="file"><br>
    <
    input type="submit" value="Send File">
    </
    form
    i need to get this working fairly urgently now.. thanks in advance

    Chris
    Last edited by sitami; Feb 6, 2004, 07:48 AM.
    ==========================
    Find A Date Or Just Friends
    @ http://www.matesonline.co.uk ==========================

  • #2
    before anyone replies.. just wanted to know if it would be worth me doing this via the ftp function istead. im a newbie to working with file uploads so dont know teh best way to go... all advice welcome
    ==========================
    Find A Date Or Just Friends
    @ http://www.matesonline.co.uk ==========================

    Comment


    • #3
      You don't need a new thread for it. Stick with the original one.

      All replies need to go in the original thread:

      http://www.codingforum.net/showthrea...threadid=32784

      And you also need to read our posting guidelines before creating any more threads.

      Closing thread...
      Spookster
      CodingForum Supreme Overlord
      All Hail Spookster

      Comment

      Working...
      X