Home » , » Cara membuat upload file dan menampilkan gambar hasil upload dengan php

Cara membuat upload file dan menampilkan gambar hasil upload dengan php

Written By Unknown on Wednesday, 12 September 2012 | 19:33

Posting ini lanjutan dari posting CARA MEMBUAT UPLOAD FILE DI PHP cuman ada perbedaannya.script ini dilengkapi dengan tampilnya gambar hasil upload , di file uploded.php pada posting CARA MEMBUAT UPLOAD FILE DI PHP ada perbedaan  dibagian:


<?php
$uploadedfile=$_FILES['uploadedfile']['name'];
$target_path="upload/";
$target_path=$target_path . basename( $_FILES['uploadedfile']['name'] );
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path))
{
echo "File " . basename($_FILES['uploadedfile']['name']) . " | Berhasil TerUpload";
}
else
{
echo("File Tidak Dapat Di Uploading, Silahkan Coba Lagi!");
}
?>

Sedangkan untuk menampilkan gambarnya di tambahkan dengan


<?
$photo=$uploadedfile;
?>
<table width="25%" height="105%" style="border:none"  class="field" align="left"  cellpadding="0" border="0" cellspacing="0" ><td height="257" align="left"><img src="upload/<? echo $photo;?>" width="261" height="292" align="middle" style="border:solid" /></td> </table>

hasilnya seperti ini

Contoh hasil upload












selamat mencoba !!!


Share this article :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Turorial Grapich Design and Blog Design - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger