DjKiller Publish time 2-2-2012 10:51 PM

Mcm mana nk paparkan gambar yang kita dh upload

korang... blh x tlg, mcm mana nk paparkan gambar yang kita dh upload.. pastu boleh delete.

kmkd Publish time 3-2-2012 04:05 PM

kau hanya perlu tambah function preview after upload la. then delete.
kalau tak mahu masuk dalam db rasanya kau kene try main dengan memory stream atau temperory table.

DjKiller Publish time 3-2-2012 07:26 PM

Reply 2# kmkd

mcm mana tu eh.. masih xphm ag..

aziz79 Publish time 3-2-2012 11:12 PM

nak upload ke mana ni bang? image hosting? website? facebook?

DjKiller Publish time 4-2-2012 03:09 AM

Reply 4# aziz79


    image hosting... Sebab buat projek tuk web hosting nie.. blh upload, tp nk paparkan ja ada masalah..

kmkd Publish time 4-2-2012 11:31 AM

tapi kau tak mahu save kan? so macam mana kau upload?

DjKiller Publish time 5-2-2012 04:43 PM

Reply 6# kmkd


    kena save juga'n kalau nk paparkan gmbar yang kita upload tu? btl x? sebb aq dh buat upload pastu blh papar. Tp bila aq cuba dua tiga kali, xmenjadi plak.. xtau ape yang xkene ag.. nie aq bagi koding yang aq buat aq guna dreamweaver cs4

<?php
include "conn_webHosting.php";
$fileName = $_FILES['upload1']['name']; //get the file name
$fileSize = $_FILES['upload1']['size']; //get the size
$fileError = $_FILES['upload1']['error']; //get the error when upload
if($fileSize > 0 || $fileError == 0){ //check if the file is corrupt or error
$move = move_uploaded_file($_FILES['upload1']['tmp_name'], 'C:/Program Files/xampp/htdocs/Sistem web host pengiklanan/Halaman Utama/pengurus_muatnaik/'.$fileName); //save image to the folder
if($move){
echo "<h3></h3>";
$q = "INSERT into pengurus_image VALUES('','$fileName','muatnaikIklan/$fileName')"; //insert image property to database
$result = mysql_query($q);

$q1 = "SELECT lokasi from pengurus_image where namaGambar = '$fileName' limit 1 "; //get the image that have been uploaded
$result = mysql_query($q1);
while ($data = mysql_fetch_array($result)) {
$loc = $data['lokasi']; ?>
<br/>
<h2> </h2>
<li><img src="<?php echo $loc; ?>" /> </li><!-- show the image using img src -->
<?php
}
} else{
echo "<h3></h3>";
}
} else {
echo "".$fileError;
}
?>

kmkd Publish time 8-2-2012 11:56 AM

so kalau tak jadi tu sebab apa? gambar tak keluar atau apa?
kalau gambar tak keluar, adakah gambar tak save (broken link) atau benda lain?

DjKiller Publish time 17-2-2012 05:32 PM

Reply 8# kmkd


    dapt dh bro caranya.. aq guna coding nie ja.. untuk paparkan gmbar yg dh di upload..

<?php
$files = glob("images/*.*");
for ($i=0; $i<count($files); $i++)
{
        $num = $files[$i];
        print $num."<br />";
        echo '<img src="'.$num.'" alt="random image" />'."<br /><br />";
}
?>
Pages: [1]
View full version: Mcm mana nk paparkan gambar yang kita dh upload


ADVERTISEMENT