Tolong pilih kategori sesuai, jenis posting (pertanyaan atau bukan) dan sertakan tag/topik yang sesuai misal komputer, php, mysql, dll.
Promosi atau posting tidak pada tempatnya akan kami hapus.
Mencantumkan kode program di posting Anda, tolong ikuti aturan yang sesuai, baca http://diskusiweb.com/discussion/39204/aturan-cara-menyisipkan-kode-program-di-diskusiweb

Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

Help,,Warning: copy() [function.copy]: Filename cannot be empty in C:\wamp\www\kirim.php on line 2



<?php

 if (copy($namafile,"gambar/$namafile_name"))

      {

      echo "Gambar telah disalin gambar/$namafile_name";

      include "con.php";      

      mysql_query ("INSERT INTO data_gambar (gambar,keterangan)

      VALUES ('$namafile_name','$fm_keterangan')");             

      }

      else {

            echo "Gagal menyalin gambar/$namafile_name";

      }

?>

Tanggapan


  • Muncul pesan :

    Notice: Undefined variable: namafile in C:\wamp\www\tes\re\kirim.php on line 2



    Notice: Undefined variable: namafile_name in C:\wamp\www\tes\re\kirim.php on line 2



    Warning: copy() [function.copy]: Filename cannot be empty in C:\wamp\www\tes\re\kirim.php on line 2



    Notice: Undefined variable: namafile_name in C:\wamp\www\tes\re\kirim.php on line 10

    Gagal menyalin gambar/

    Kira2 dimana kesalahannya MASTER....???mohon bantuannya
  • variabel yang dimasukkan nggak sesuai => $namafile  $namafile_name
    coba cek lagi file php nya, mungkin recordset dicek lagi

    mf kalo kliru ngasih solusi, coz sama-sama masih belajar.. :)
  • edited November 2012
    udah k rubah...tapi gambar ngga keluar...padahal upload sukse..

    ni script yg d rubah


    <?php
    if( $_REQUEST['keterangan']) {
    if(@copy($_FILES['namafile']['tmp_name'], $_FILES['namafile']['name'])) {
    include "conect.php";
    $judul = $_POST['judul'];
    $gambar = $_FILES['gambar'];
    $ukuran=$_FILES['gambar']['size'];
    $keterangan = $_POST['keterangan'];
    mysql_query ("INSERT INTO data (judul,gambar,keterangan)
        VALUES ('$judul','$gambar','$keterangan')");   


    ?>
    <b>Upload SUKSES !!! | <a href="<?php echo $_FILES['namafile']['name']; ?>" target="_blank">Hasil</a></b>
    <?php
    } else {
    ?>
    <b>Upload GAGAL !!!</b>
    <?php
    }
    }
    ?>

    Tolong solusinya MASTER...??????
  • gambar gak keluar gimana ?
    pan emang kagak ditampilin pake <img>
Sign In or Register to comment.