D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
lampp
/
htdocs
/
admin
/
Filename :
addGal.php
back
Copy
<?php require_once ('db.php'); if (isset($_POST['Submit'])) { move_uploaded_file($_FILES["image"]["tmp_name"],"gallery/" . $_FILES["image"]["name"]); $image = $_FILES["image"]["name"]; $alt=$_POST['alt']; $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "INSERT INTO gallery (alt, image) VALUES ('$alt', '$image')"; $conn->exec($sql); echo "<script>alert('Successfully Added!!!'); window.location='gallery.php'</script>"; // } } // } ?>