vdp

Untitled

vdp
Jul 31st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <html>
  2. <head></head>
  3.  
  4. <body>
  5.  
  6. <form action="" method="post" bgcolor="#BDBD9D">
  7.  
  8.  
  9.             <h3> Do you really want to delete your account ? </h3>
  10.  
  11.             <input class="btn btn-success" type="submit" name="yes" value="Yes, Delete My account"/>
  12.             <input type="submit" class="btn btn-danger" name="no" value="No,Take me away"/>
  13.  
  14.  
  15. </form>
  16.  
  17. <?php
  18.  
  19. include("../includes/db.php");
  20.     $c=$_SESSION['customer_email'];
  21.  
  22.     if(isset($_POST['yes']))
  23.     {
  24.         $delete_customer="delete from customers where customer_email='$c'";
  25.         $run_delete=mysqli_query($con,$delete_customer);
  26.  
  27.         if($run_delete)
  28.         {
  29.             session_destroy();
  30.             echo "<script> alert('Your account has been deleted,Good Bye!')</script>";
  31.             echo "<script>window.open('../index.php','_self')</script>";
  32.         }
  33.         else
  34.         {
  35.             echo "<script> alert('Failed')</script>";
  36.         }
  37.     }
  38.  
  39.         if(isset($_POST['no']))
  40.         {
  41.             echo "<script>window.open('my_account.php','_self')</script>";
  42.            
  43.         }
  44.    
  45.  
  46. ?>
  47.  
  48. </body>
  49.  
  50. </html>
Add Comment
Please, Sign In to add comment