Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post" enctype="multipart/form-data">
- <input type="file" name="image"/>
- <input type="submit" name="upload" value="Uploaded"/>
- </form>
- <?php
- session_start();
- $host="localhost";
- $username = "root";
- $password = "";
- $dbname = "image";
- $conn = new mysqli($host, $username, $password, $dbname);
- if(isset($_POST['upload'])){
- $image=addcslashes($_FILES['image']['tmp_name']);
- $name=addcslashes($_FILES['image']['name']);
- $image=file_get_contents($image);
- $image=base64_encode($image);
- mysqli_query("inset into image(dbid,image) values('','$image')");
- echo "image upload";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement