Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. include '../session.php';
  4. require_once 'config.php';
  5.  
  6. if (isset($_POST['submit'])) {
  7.  
  8. $imageName = $_FILES["latest_photo"]["name"];
  9. $imageData = file_get_contents($_FILES["latest_photo"]["tmp_name"]);
  10. $imageType = $_FILES["latest_photo"]["type"];
  11.  
  12. if (substr($imageType, 0,5) == "image") {
  13.  
  14. $query = "UPDATE `crew_info` SET `image_name` = ? AND `updated_photo` = ? WHERE `id` = ?";
  15. $stmt = mysqli_prepare($conn, $query);
  16. mysqli_stmt_bind_param($stmt, 'ssi', $imageName, $imageData, $_POST['id']);
  17. mysqli_stmt_execute($stmt);
  18.  
  19. }
  20.  
  21. else {
  22.  
  23. echo "Image not Uploaded!";
  24.  
  25. }
  26.  
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement