PHP Image Upload

ass ................... for my second article I will discuss how to upload photos / images jpg, Jpeg etc.. to upload an image in php ituh very easy it can be said that the basic easy but if you are creative, people can upload pictures so uncommon and is not easy anymore. Ga lot of strings attached again I will start to upload images as well ... we need a database okay to database problems we already ga I think you have whiz table first of all we prepared for upload should calm gamabarnya Copas ko hehehe .... : D

   CREATE TABLE `tb_upload` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `image` TEXT NOT NULL) ENGINE = MYISAM;

For the second one we make for upload form script gambarnya.dan lifeline shelf

<? php
if (isset ($ _POST ['upload'])) {
  $ tipe_file = $ _FILES ['image'] ['type'];
  $ formatgambar = array ("image / jpg", "image / jpeg", "image / gif", "image / png");
$ namaimage = $ _FILES ['image'] ['name'];/ / create ngambil image name
$ alamatimage = $ _FILES ['image'] ['tmp_name'];/ / create the image address
$ image = move_uploaded_file ($ alamatimage, 'upload / images /'. $ namaimage);/ / this script mindahinnya "upload / images /" ituh want to save the image in the folder where you free up
mysql_query ("INSERT INTO` tutorial `.` tb_upload `(
`id`,
`image`
)
VALUES (
'', '$ Namaimage'
) ");
echo "been able to upload";
}
?>
The source code is action="" method="POST" enctype="multipart/form-data" name="form1">
   <table width="200" border="1">
     <tr>
       <td width="58"> Picture </ td>
       <td width="126"> <label for="image"> </ label>
       <input type="file" name="image"> </ td>
     </ tr>
     <tr>
       <td> </ td>
       <td> <input type="submit" name="upload" value="upload"> </ td>
     </ tr>
   </ table>
</ form>

  selsai may be useful for you and for me aminn worship <
wasssalam

Source MYBLOG Inspirasi OF Dreams

Penulis : Unknown ~ Sebuah blog yang menyediakan berbagai macam informasi

Artikel PHP Image Upload ini dipublish oleh Unknown pada hari Thursday, July 25, 2013. Semoga artikel ini dapat bermanfaat.Terimakasih atas kunjungan Anda silahkan tinggalkan komentar.sudah ada 0 komentar: di postingan PHP Image Upload
 

0 comments:

Post a Comment