Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. $db = mysqli_connect("127.0.0.1", "bnubseen_db40", "21319344$!", "bnubseen_db40");
  4.  
  5. //Obtain the file sent to the server within the response.
  6. $image = $_FILES['monsterimage']['tmp_name'];
  7. $audio = $_FILES['monsteraudio']['tmp_name'];
  8.  
  9. //Get the file binary data
  10. $imagedata = addslashes(fread(fopen($image, "r"), filesize($image)));
  11. $audiodata = addslashes(fread(fopen($audio, "r"), filesize($audio)));
  12.  
  13. $sql = "INSERT INTO monster";
  14. $sql = "(Name, Image, Audio)";
  15. $sql = "VALUES ('$_POST[txtname]','$imagedata','$audiodata');";
  16.  
  17. $result = mysqli_query($db, $sql);
  18.  
  19. echo $sql;
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement