How to upload an image to database using php
<?php error_reporting(0); //for no error reporting ?> <html> <head> <title>img insert</title> </head> <body> <?php $filename = $_FILES["image"] ["name"]; $tempname = $_FILES["image"] ["tmp_name"]; $folder = "img/" . $filename; //giving your folder directory move_uploaded_file($tempname,$folder); //for moving uploaded file to ur own folder ?> <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="image" /> <input type="submit" name="submit" /> </form> <?php if(isset($_POST["submit"])) { ?> <img src="<?php echo $folder ?>" height="auto" width="auto"> <?php } ?> //showing image </body> </html>
POST COMMENTS