lawang code

lawang Code


Tanyakan kode disini

[PHP] Help mastah, Upload File ga work

ditanyakan oleh M Syamsul Rizal 3 tahun yang lalu

Tolong bantuannya para mastah, ane lagi belajar PHP nih, skrg ane lagi belajar proses upload gan, scriptnya ga ada yg error pas di jalanin tapi ga work sama sekali, file yg di uploadnya ga ada. ni script yg ane buat gan.

<?php
if (isset($_FILES['file'])) {
    echo "Name : " . $_FILES['file']['name'] . "<br>";
    echo "Size : " . $_FILES['file']['size'] . "bytes<br>";
    echo "Temp Name : " . $_FILES['file']['tmp_name'] . "<br>";
    echo "Type : " . $_FILES['file']['type'] . "<br>";
    echo "Error : " . $_FILES['file']['error'] . "<br>";

    if ($_FILES['file']['type'] == "image/jpg/jpeg") {
        $source = $_FILES['file']['tmp_name'];

        $target = "./upload/" . $_FILES['file']['name'];

        move_uploaded_file($source, $target);

        $size = getImageSize($target);

        $imageupload = "<p><img width=\"$size[0]\" height=\"$size[1]\" " . "src=\"$target\" alt=\"uploaded image\" /></p>";
        echo $imageupload;
    }
  }
?>    

ada yg salah ga sma script ini ??? kalo ane coba eksekusi form nya, tampilannya kya gini keluaran proses

Menampilkan 1-1 dari 1 hasil
handita okviyanto menjawab 3 tahun yang lalu :

formnya gmana yah udah pake

<form enctype="multipart/form-data"         

belum?


Anda harus login terlebih dahulu untuk memberikan komentar

Recent Tag

X 6
X 48
X 14
X 10
X 1
X 5
X 4
X 18
X 10

Bantuan

Help

Feedback

Help