Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once ('db.php');
- if (isset($_POST['Submit'])) {
- // echo "";
- // }else{
- // $file=$_FILES['image']['tmp_name'];
- // $image = $_FILES["image"] ["name"];
- // $image_name= addslashes($_FILES['image']['name']);
- // $size = $_FILES["image"] ["size"];
- // $error = $_FILES["image"] ["error"];
- //
- // if ($error > 0){
- // die("Error uploading file! Code $error.");
- // }else{
- // if($size > 10000000) //conditions for the file
- // {
- // die("Format is not allowed or file size is too big!");
- // }
- //
- // else
- // {
- move_uploaded_file($_FILES["image"]["tmp_name"],"uploads/" . $_FILES["image"]["name"]);
- $location=$_FILES["image"]["name"];
- $name=$_POST['name'];
- $deskripsi=$_POST['deskripsi'];
- $paket=$_POST['paket']
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql = "INSERT INTO tbl_image (name, deskripsi, paket, image_location)
- VALUES ('$name', '$deskripsi', '$paket', '$location')";
- $conn->exec($sql);
- echo "<script>alert('Successfully Added!!!'); window.location='index.php'</script>";
- // }
- }
- // }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement