Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2.  
  3. if (isset($_POST['aku'])){
  4.     $tipefile = $_FILES['gambarbaru']['type'];
  5.     if($tipefile == "image/jpeg" || $tipefile == "image/png" || $tipefile == "image/gif" ){
  6.         include "inc/resize.gambar.php";
  7.         $lokasigambar   =   $_FILES['gambarbaru']['tmp_name'];
  8.         $namafile       =   time().$_FILES['gambarbaru']['name'];
  9.         $namafile       = str_replace("'","",$namafile);
  10.         move_uploaded_file($lokasigambar,$namafile);
  11.         resize_gambar($namafile,$tipefile);
  12.         echo "$lokasigambar * $tipefile * $namafile";
  13.         $forum->query("UPDATE user SET gambar='$namafile' WHERE id_user='$id_user'");
  14.         if($foto != "static/img/user/default.png"){unlink($foto);}
  15.         header("location:gantidp.php");
  16.         echo "<script>document.location = 'gantidp.php';</script>";
  17.     }
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement