<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="css/bootstrap.css"/> <link rel="stylesheet" href="css/bootstrap.min.css"/> </head> <body> <div class="col-md-6"> <form action="upload.php" method="post" enctype="multipart/form-data"> <label for="">Item</label><br /> <input type="file" name="picture" class="form-control"><br /> <label for="">Description</label><br /> <textarea name="description" id="" placeholder="Enter Item Description" class="form-control" cols="50" rows="20"></textarea><br /> <input type="submit" name="submit" value="Upload" class="btn btn-success"> </form> </div> <script src="js/bootstrap.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/jquery-2.1.1.min.js"></script> </body> </html>
include 'conn.php';<br /> $desc=$_POST['description'];<br /> $image=$_FILES['picture'];<br /> $image_name=$_FILES['picture']['name'];<br /> $placed='uploads/';<br /> if(move_uploaded_file($_FILES['picture']['tmp_name'],$placed.$image_name))<br /> {<br /> $smt=$conn->prepare("INSERT INTO images(Image_Name,Description,Placed_On)VALUES('".$image_name."','".$desc."','".$placed."')");<br /> $smt->execute();<br /> header('location:form.php');<br /> <br /> }<br /> else<br /> {<br /> echo 'error on uploading file';<br /> }<br /> ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)