Advertisement
wrcspkkit

deletepic.php

May 5th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. $PhotoURL = $_GET['photo_id']; // Grab the album
  5.            
  6. $servername = "localhost";
  7. $username = "PKKIT";     // Set up the SQL server details.
  8. $password = "jeznicklogan";
  9. $dbname = "PKKIT";
  10. $AccountID = $_SESSION['AccountID'];
  11. // Create connection
  12. $conn = new mysqli($servername, $username, $password, $dbname);
  13.  
  14. // Check connection
  15. if ($conn->connect_error) {
  16.     die("Connection failed: " . $conn->connect_error);
  17.  }
  18. $sql = mysqli_query($conn, "DELETE FROM photo WHERE file_url='$PhotoURL'"); // DELETE Album for Every user
  19.  
  20. echo "<script>alert('The photo has been removed!');";
  21. echo "window.location='myphotos.php';</script>";
  22.  
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement