Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if( $_SESSION["username"]==""){
- header("Location: http://filewallet.site88.net/");
- }
- else{
- $servername = "mysql1.000webhost.com";
- $username = "a9691255_naveed";
- $password = "abmirzass123";
- $dbname = "a9691255_webiste";
- $userid=$_SESSION["username"];
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- }
- $path=$_GET["path"];
- $choice=$_GET["choice"];
- if($choice==1){
- $delete_query="delete from fileuploads where userid= '".$userid."' and filepath ='".$path."'";
- if ($conn->query($delete_query) === TRUE) {
- unlink($filepath);
- echo "Record deleted successfully";
- header("Location: http://filewallet.site88.net/main.php?delfilcheck=1");
- } else {
- header("Location: http://filewallet.site88.net/main.php?delfilcheck=2");
- }
- $conn->close(); }
- else{
- if(rmdir($path)){
- header("Location: http://filewallet.site88.net/main.php?delfolcheck=1");
- }
- else{
- header("Location: http://filewallet.site88.net/main.php?delfolcheck=2");}
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement