• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP htmlEncode2函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中htmlEncode2函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlEncode2函数的具体用法?PHP htmlEncode2怎么用?PHP htmlEncode2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了htmlEncode2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    // -------------------------------------------------------------------------
    // Variables
    // -------------------------------------------------------------------------
    $filename_extension = get_filename_extension($net2ftp_globals["entry"]);
    // ------------------------
    // Set the state2 variable depending on the file extension !!!!!
    // ------------------------
    if (getFileType($net2ftp_globals["entry"]) == "IMAGE") {
        $filetype = "image";
    } elseif ($filename_extension == "swf") {
        $filetype = "flash";
    } else {
        $filetype = "text";
    }
    // Form name, back and forward buttons
    $formname = "ViewForm";
    $back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
    // Next screen
    $nextscreen = 2;
    // -------------------------------------------------------------------------
    // Text
    // -------------------------------------------------------------------------
    if ($filetype == "text") {
        // Title
        $title = __("View file %1\$s", $net2ftp_globals["entry"]);
        // ------------------------
        // geshi_text
        // ------------------------
        setStatus(2, 10, __("Reading the file"));
        $geshi_text = ftp_readfile("", $net2ftp_globals["directory"], $net2ftp_globals["entry"]);
        if ($net2ftp_result["success"] == false) {
            return false;
        }
        // ------------------------
        // geshi_language
        // ------------------------
        $geshi_language = "";
        $list_language_extensions = array('html4strict' => array('html', 'htm'), 'javascript' => array('js'), 'css' => array('css'), 'php' => array('php', 'php5', 'phtml', 'phps'), 'perl' => array('pl', 'pm', 'cgi'), 'sql' => array('sql'), 'java' => array('java'), 'actionscript' => array('as'), 'ada' => array('a', 'ada', 'adb', 'ads'), 'apache' => array('conf'), 'asm' => array('ash', 'asm'), 'asp' => array('asp'), 'bash' => array('sh'), 'c' => array('c', 'h'), 'c_mac' => array('c'), 'caddcl' => array(), 'cadlisp' => array(), 'cpp' => array('cpp'), 'csharp' => array(), 'd' => array(''), 'delphi' => array('dpk'), 'diff' => array(''), 'email' => array('eml', 'mbox'), 'lisp' => array('lisp'), 'lua' => array('lua'), 'matlab' => array(), 'mpasm' => array(), 'nsis' => array(), 'objc' => array(), 'oobas' => array(), 'oracle8' => array(), 'pascal' => array('pas'), 'python' => array('py'), 'qbasic' => array('bi'), 'smarty' => array('tpl'), 'vb' => array('bas'), 'vbnet' => array(), 'vhdl' => array(), 'visualfoxpro' => array(), 'xml' => array('xml'));
        while (list($language, $extensions) = each($list_language_extensions)) {
            if (in_array($filename_extension, $extensions)) {
                $geshi_language = $language;
                break;
            }
        }
        // ------------------------
        // geshi_path
        // ------------------------
        $geshi_path = NET2FTP_APPLICATION_ROOTDIR . "/plugins/geshi/geshi/";
        // ------------------------
        // Call geshi
        // ------------------------
        setStatus(4, 10, __("Parsing the file"));
        $geshi = new GeSHi($geshi_text, $geshi_language, $geshi_path);
        $geshi->set_encoding(__("iso-8859-1"));
        $geshi->set_header_type(GESHI_HEADER_PRE);
        $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
        //		$geshi->enable_classes();
        $geshi->set_overall_style('border: 2px solid #d0d0d0; background-color: #f6f6f6; color: #000066; padding: 10px;', true);
        $geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
        $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
        $geshi->set_tab_width(4);
        $geshi_text = $geshi->parse_code();
    } elseif ($filetype == "image") {
        $title = __("View image %1\$s", htmlEncode2($net2ftp_globals["entry"]));
        $image_url = printPHP_SELF("view");
        $image_alt = __("Image") . $net2ftp_globals["entry"];
    } elseif ($filetype == "flash") {
        $title = __("View Macromedia ShockWave Flash movie %1\$s", htmlEncode2($net2ftp_globals["entry"]));
        $flash_url = printPHP_SELF("view");
    }
    // -------------------------------------------------------------------------
    // Print the output
    // -------------------------------------------------------------------------
    require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php";
}
开发者ID:rohdoor,项目名称:Zpanel-net2ftp,代码行数:84,代码来源:view.inc.php


示例2: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the edit screen
    // For screen == 1, the file is read from the FTP server
    // For screen == 2, the textarea is changed, the file is not read from the FTP server but comes from the HTML form
    // For screen == 3, the file is saved to the FTP server
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    if (isset($_POST["textareaType"]) == true) {
        $textareaType = validateTextareaType($_POST["textareaType"]);
    } else {
        $textareaType = "";
    }
    if (isset($_POST["text"]) == true) {
        $text = $_POST["text"];
    } else {
        $text = "";
    }
    if (isset($_POST["text_splitted"]) == true) {
        $text_splitted = $_POST["text_splitted"];
    } else {
        $text_splitted = "";
    }
    if (isset($_POST["encodingSelect"]) == true) {
        $encodingSelect = $_POST["encodingSelect"];
    } else {
        $encodingSelect = "";
    }
    if (isset($_POST["breakSelect"]) == true) {
        $breakSelect = $_POST["breakSelect"];
    } else {
        $breakSelect = "";
    }
    $text_encoding_selected = "";
    $line_break_selected = "";
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Form name, back and forward buttons
    $formname = "EditForm";
    $back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
    // Directory + file name
    $dirfilename = htmlEncode2(glueDirectories($net2ftp_globals["directory"], $net2ftp_globals["entry"]));
    // TextareaSelect onchange
    $onchange = "document.forms['EditForm'].screen.value=2;document.forms['EditForm'].textareaType.value=document.forms['EditForm'].textareaSelect.options[document.forms['EditForm'].textareaSelect.selectedIndex].value;document.forms['EditForm'].submit();";
    // Character encoding (requires multibyte string module to be installed)
    // With this, you can save a text with specified encoding and line break sequence
    // http://www.net2ftp.org/forums/viewtopic.php?id=2449
    if (($net2ftp_globals["language"] == "ja" || $net2ftp_globals["language"] == "tc" || $net2ftp_messages["iso-8859-1"] == "UTF-8") && function_exists("mb_detect_encoding") == true) {
        // $textarea_encodings is an array which contains the possible character encodings
        $textarea_encodings = getTextareaEncodingsArray();
        // $textarea_breaks is an array which contains the possible line breaks
        $textarea_breaks[] = "CRLF";
        $textarea_breaks[] = "CR";
        $textarea_breaks[] = "LF";
        // $text_encoding_old is the original encoding which is detected when the file is first read
        // $text_encoding_new is the requested encoding from the drop-down box
        // Default = encoding used for the page, which is defined by the language file in /languages/xx.inc.php
        // HTML uses BIG5, PHP uses BIG-5 (Traditional Chinese)
        // If the HTML encoding is not foreseen in the PHP function, set it to the default ISO-8859-1
        // $text_encoding is changed further on too
        if ($encodingSelect != "" && in_array($encodingSelect, $textarea_encodings)) {
            $text_encoding_new = $encodingSelect;
        } else {
            $text_encoding_new = "";
        }
        // $line_break_old is the original line break which is detected when the file is first read
        // $line_break is the requested line break from the drop-down box
        if ($breakSelect != "" && in_array($breakSelect, $textarea_breaks) == true) {
            $line_break_new = $breakSelect;
        } else {
            $line_break_new = "LF";
        }
    }
    // Programming language (for CodePress syntax highlighting)
    if ($textareaType == "codepress") {
        $filename_extension = get_filename_extension($net2ftp_globals["entry"]);
        if ($filename_extension == "asp") {
            $codepress_programming_language = "asp";
        } elseif ($filename_extension == "css") {
            $codepress_programming_language = "css";
        } elseif ($filename_extension == "cgi") {
            $codepress_programming_language = "perl";
        } elseif ($filename_extension == "htm") {
            $codepress_programming_language = "html";
        } elseif ($filename_extension == "html") {
            $codepress_programming_language = "html";
        } elseif ($filename_extension == "java") {
            $codepress_programming_language = "java";
        } elseif ($filename_extension == "js") {
            $codepress_programming_language = "javascript";
        } elseif ($filename_extension == "javascript") {
            $codepress_programming_language = "javascript";
        } elseif ($filename_extension == "pl") {
            $codepress_programming_language = "perl";
        } elseif ($filename_extension == "perl") {
//.........这里部分代码省略.........
开发者ID:rohdoor,项目名称:Zpanel-net2ftp,代码行数:101,代码来源:edit.inc.php


示例3: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the rename screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
    if (isset($_POST["list"]) == true) {
        $list = getSelectedEntries($_POST["list"]);
    } else {
        $list = "";
    }
    if (isset($_POST["newNames"]) == true) {
        $newNames = validateEntry($_POST["newNames"]);
    } else {
        $newNames = "";
    }
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Title
    $title = __("Rename directories and files");
    // Form name, back and forward buttons
    $formname = "RenameForm";
    $back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
    $forward_onclick = "document.forms['" . $formname . "'].submit();";
    // -------------------------------------------------------------------------
    // Variables for screen 1
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["screen"] == 1) {
        // Next screen
        $nextscreen = 2;
    } elseif ($net2ftp_globals["screen"] == 2) {
        // Open connection
        setStatus(2, 10, __("Connecting to the FTP server"));
        $conn_id = ftp_openconnection();
        if ($net2ftp_result["success"] == false) {
            return false;
        }
        // Rename files
        setStatus(4, 10, __("Processing the entries"));
        for ($i = 1; $i <= sizeof($list["all"]); $i++) {
            if (strstr($list["all"][$i]["dirfilename"], "..") != false) {
                $net2ftp_output["rename"][] = __("The new name may not contain any dots. This entry was not renamed to <b>%1\$s</b>", htmlEncode2($newNames[$i])) . "<br />";
                continue;
            }
            if (checkAuthorizedName($newNames[$i]) == false) {
                $net2ftp_output["rename"][] = __("The new name may not contain any banned keywords. This entry was not renamed to <b>%1\$s</b>", htmlEncode2($newNames[$i])) . "<br />";
                continue;
            }
            ftp_rename2($conn_id, $net2ftp_globals["directory"], $list["all"][$i]["dirfilename"], $newNames[$i]);
            if ($net2ftp_result["success"] == false) {
                setErrorVars(true, "", "", "", "");
                $net2ftp_output["rename"][] = __("<b>%1\$s</b> could not be renamed to <b>%2\$s</b>", htmlEncode2($list["all"][$i]["dirfilename"]), htmlEncode2($newNames[$i]));
                continue;
            } else {
                $net2ftp_output["rename"][] = __("<b>%1\$s</b> was successfully renamed to <b>%2\$s</b>", htmlEncode2($list["all"][$i]["dirfilename"]), htmlEncode2($newNames[$i]));
            }
        }
        // End for
        // Close connection
        ftp_closeconnection($conn_id);
    }
    // end elseif
    // -------------------------------------------------------------------------
    // Print the output
    // -------------------------------------------------------------------------
    require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php";
}
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:71,代码来源:rename.inc.php


示例4: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    // -------------------------------------------------------------------------
    // Variables
    // -------------------------------------------------------------------------
    $filename_extension = get_filename_extension($net2ftp_globals["entry"]);
    // ------------------------
    // Set the state2 variable depending on the file extension !!!!!
    // ------------------------
    if (getFileType($net2ftp_globals["entry"]) == "IMAGE") {
        $filetype = "image";
    } elseif ($filename_extension == "swf") {
        $filetype = "flash";
    } else {
        $filetype = "text";
    }
    // Form name, back and forward buttons
    $formname = "ViewForm";
    $back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
    // Next screen
    $nextscreen = 2;
    // -------------------------------------------------------------------------
    // Text
    // -------------------------------------------------------------------------
    if ($filetype == "text") {
        // Title
        $title = __("View file %1\$s", $net2ftp_globals["entry"]);
        // ------------------------
        // luminous_text
        // ------------------------
        setStatus(2, 10, __("Reading the file"));
        $luminous_text = ftp_readfile("", $net2ftp_globals["directory"], $net2ftp_globals["entry"]);
        if ($net2ftp_result["success"] == false) {
            return false;
        }
        // ------------------------
        // luminous_language
        // ------------------------
        $luminous_language = "";
        $list_language_extensions = array('html' => array('html', 'htm'), 'javascript' => array('js'), 'css' => array('css'), 'php' => array('php', 'php5', 'phtml', 'phps'), 'perl' => array('pl', 'pm', 'cgi'), 'sql' => array('sql'), 'java' => array('java'), 'ada' => array('a', 'ada', 'adb', 'ads'), 'as' => array('as'), 'asp' => array('asp'), 'cpp' => array('cpp'), 'csharp' => array('csharp'), 'diff' => array('diff'), 'go' => array('go'), 'latex' => array('latex'), 'matlab' => array('matlab'), 'python' => array('py'), 'rails' => array('rails'), 'ruby' => array('ruby'), 'sql' => array('sql'), 'vb' => array('bas'), 'vim' => array('vim'), 'xml' => array('xml'));
        while (list($language, $extensions) = each($list_language_extensions)) {
            if (in_array($filename_extension, $extensions)) {
                $luminous_language = $language;
                break;
            }
        }
        // ------------------------
        // Call luminous
        // ------------------------
        setStatus(4, 10, __("Parsing the file"));
        $luminous_text = luminous::highlight($luminous_language, $luminous_text, FALSE);
    } elseif ($filetype == "image") {
        $title = __("View image %1\$s", htmlEncode2($net2ftp_globals["entry"]));
        $image_url = printPHP_SELF("view");
        $image_alt = __("Image") . $net2ftp_globals["entry"];
    } elseif ($filetype == "flash") {
        $title = __("View Macromedia ShockWave Flash movie %1\$s", htmlEncode2($net2ftp_globals["entry"]));
        $flash_url = printPHP_SELF("view");
    }
    // -------------------------------------------------------------------------
    // Print the output
    // -------------------------------------------------------------------------
    require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php";
}
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:71,代码来源:view.inc.php


示例5: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    if (isset($_POST["input_admin_username"]) == true) {
        $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"]));
    } else {
        $input_admin_username = "";
    }
    if (isset($_POST["input_admin_password"]) == true) {
        $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"]));
    } else {
        $input_admin_password = "";
    }
    // -------------------------------------------------------------------------
    // Variables
    // -------------------------------------------------------------------------
    // Title
    $title = __("Admin functions");
    // Form name, back and forward buttons
    $formname = "AdminForm";
    $back_onclick = "document.forms['" . $formname . "'].state.value='login';document.forms['" . $formname . "'].submit();";
    // Current build number
    $application_build_nr = $net2ftp_settings["application_build_nr"];
    // Date from and to
    $today = date("Y-m-d");
    $oneweekago = date("Y-m-d", time() - 3600 * 24 * 7);
    $datefrom = $oneweekago;
    $dateto = $today;
    // -------------------------------------------------------------------------
    // Print the output
    // -------------------------------------------------------------------------
    require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php";
}
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:39,代码来源:admin.inc.php


示例6: while

// end if
?>

<?php 
if (is_array($zipactions) == true) {
    for ($i = 1; $i <= sizeof($list["all"]); $i++) {
        while (list($key, $value) = each($list["all"][$i])) {
            ?>
<input type="hidden" name="list[<?php 
            echo $i;
            ?>
][<?php 
            echo htmlEncode2($key);
            ?>
]" value="<?php 
            echo htmlEncode2($value);
            ?>
" />
<?php 
        }
        // end while
    }
    // end for
}
// end if
?>

<div style="border: 1px solid black; background-color: #DDDDDD; width: 400px; margin-<?php 
echo __("left");
?>
: auto; margin-<?php 
开发者ID:Gemorroj,项目名称:net2ftp,代码行数:31,代码来源:login_small.template.php


示例7: getSelectedEntries

function getSelectedEntries($list)
{
    // --------------
    // Input = array where dirfilename is set if the entry was selected, not set if not selected:
    //   [1] => Array ( [dirfilename] => dir1 [dirorfile] => d [size] => 0 [selectable] => ok      [permissions] => ---rw-rw- )   <-- selected
    //   [2] => Array ( [dirfilename] => dir2 [dirorfile] => d [size] => 0 [selectable] => ok      [permissions] => ---rw-rw- )   <-- selected
    //   [3] => Array ( [dirfilename] => dir3 [dirorfile] => d [size] => 0 [selectable] => too_big [permissions] => ---rw-rw- )   <-- selected
    //   [4] => Array (                       [dirorfile] => d [size] => 0 [selectable] => ok      [permissions] => ---rw-rw- )   <-- not selected
    //
    // Output = array with only the selected entries, which are not TOO BIG or which do not contain a forbidden keyword
    //   [1] => Array ( [dirfilename] => dir1 [dirorfile] => d [size] => 0 [permissions] => ---rw-rw- )
    //   [2] => Array ( [dirfilename] => dir2 [dirorfile] => d [size] => 0 [permissions] => ---rw-rw- )
    // --------------
    // Global variables
    global $net2ftp_globals;
    $newlist = array();
    $newlist["directories"] = array();
    $newlist["files"] = array();
    $newlist["symlinks"] = array();
    $newlist["unrecognized"] = array();
    $directory_index = 1;
    $file_index = 1;
    $symlink_index = 1;
    $unrecognized_index = 1;
    $all_index = 1;
    for ($i = 1; $i <= sizeof($list); $i = $i + 1) {
        if (isset($list[$i]["dirorfile"]) == true && isset($list[$i]["dirfilename"]) == true) {
            if (isset($list[$i]["selectable"]) == false || $list[$i]["selectable"] != "ok" && ($net2ftp_globals["state"] == "downloadfile" || $net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "edit" || $net2ftp_globals["state"] == "findstring" || $net2ftp_globals["state"] == "unzip" || $net2ftp_globals["state"] == "view" || $net2ftp_globals["state"] == "zip" || $net2ftp_globals["state2"] == "copy" || $net2ftp_globals["state2"] == "move")) {
                continue;
            }
            $list[$i]["dirfilename"] = validateGenericInput($list[$i]["dirfilename"]);
            $list[$i]["dirfilename_html"] = htmlEncode2($list[$i]["dirfilename"]);
            $list[$i]["dirfilename_js"] = javascriptEncode2($list[$i]["dirfilename"]);
            if ($list[$i]["dirorfile"] == "d") {
                $newlist["directories"][$directory_index] = $list[$i];
                $directory_index++;
                $newlist["all"][$all_index] = $list[$i];
                $all_index++;
            } elseif ($list[$i]["dirorfile"] == "-") {
                $newlist["files"][$file_index] = $list[$i];
                $file_index++;
                $newlist["all"][$all_index] = $list[$i];
                $all_index++;
            } elseif ($list[$i]["dirorfile"] == "l") {
                $newlist["symlinks"][$symlink_index] = $list[$i];
                $symlink_index++;
                $newlist["all"][$all_index] = $list[$i];
                $all_index++;
            } elseif ($list[$i]["dirorfile"] == "u") {
                $newlist["unrecognized"][$unrecognized_index] = $list[$i];
                $unrecognized_index++;
                $newlist["all"][$all_index] = $list[$i];
                $all_index++;
            }
        }
    }
    // end for
    // Store the statistics
    $newlist["stats"]["directories"]["total_number"] = $directory_index - 1;
    $newlist["stats"]["files"]["total_number"] = $file_index - 1;
    $newlist["stats"]["symlinks"]["total_number"] = $symlink_index - 1;
    $newlist["stats"]["unrecognized"]["total_number"] = $unrecognized_index - 1;
    return $newlist;
}
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:64,代码来源:filesystem.inc.php


示例8: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    // -------------------------------------------------------------------------
    // Variables
    // -------------------------------------------------------------------------
    // ------------------------------------
    // Title
    // ------------------------------------
    $login_title = __("Login!");
    // ------------------------------------
    // FTP server
    //	    $ftpserver["inputType"] can be "text", "select" or "hidden"
    //	    $ftpserver"][$i]["text"] is "ftp.server.com"
    //	    $ftpserver"][$i]["selected"] is "selected" or ""
    // ------------------------------------
    // All FTP servers are allowed
    // Prefill the textbox with the value that was filled in (when changing the language the page refreshes)
    // or else with the value from the cookie
    if ($net2ftp_settings["allowed_ftpservers"][1] == "ALL") {
        // Input type is textbox
        $ftpserver["inputType"] = "text";
        // Prefill with the previous input value
        if ($net2ftp_globals["ftpserver"] != "") {
            $ftpserver["list"][1] = htmlEncode2($net2ftp_globals["ftpserver"]);
        } else {
            $ftpserver["list"][1] = htmlEncode2($net2ftp_globals["cookie_ftpserver"]);
        }
    } elseif (sizeof($net2ftp_settings["allowed_ftpservers"]) > 1) {
        // Input type is drop-down box
        $ftpserver["inputType"] = "select";
        // List of allowed FTP servers
        $ftpserver["list"] = $net2ftp_settings["allowed_ftpservers"];
        // Preselect the right FTP server
        // ... using the previous input value
        $array_search_result1 = array_search($net2ftp_globals["ftpserver"], $ftpserver);
        if (is_numeric($array_search_result1) == true) {
            $ftpserver["list"][$array_search_result1]["selected"] = "selected=\"selected\"";
        } else {
            $array_search_result2 = array_search($net2ftp_globals["cookie_ftpserver"], $ftpserver);
            if (is_numeric($array_search_result2) == true) {
                $ftpserver["list"][$array_search_result2]["selected"] = "selected=\"selected\"";
            }
        }
    } elseif (sizeof($net2ftp_settings["allowed_ftpservers"]) == 1) {
        $ftpserver["inputType"] = "hidden";
        $ftpserver["list"][1] = $net2ftp_settings["allowed_ftpservers"][1];
    } else {
        $errormessage = "There is an error in the net2ftp configuration file <b>settings_authorizations.inc.php</b>: variable <b>\$net2ftp_allowed_ftpservers</b> does not follow the expected format.";
        setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
        return false;
    }
    // ------------------------------------
    // FTP server port
    //	    $ftpserverport["inputType"] can be "text" or "hidden"
    //	    $ftpserverport is "21"
    // ------------------------------------
    if ($net2ftp_settings["allowed_ftpserverport"] == "ALL") {
        // Input type is textbox
        $ftpserverport["inputType"] = "text";
        // Prefill with the previous input value
        if ($net2ftp_globals["ftpserverport"] != "") {
            $ftpserverport["value"] = htmlEncode2($net2ftp_globals["ftpserverport"]);
        } elseif ($net2ftp_globals["cookie_ftpserverport"] != "") {
            $ftpserverport["value"] = htmlEncode2($net2ftp_globals["cookie_ftpserverport"]);
        } else {
            $ftpserverport["value"] = 21;
        }
    } else {
        $ftpserverport["inputType"] = "hidden";
        $ftpserverport["value"] = $net2ftp_settings["allowed_ftpserverport"];
    }
    // ------------------------------------
    // Username
    // ------------------------------------
    // Prefill with the previous input value
    if ($net2ftp_globals["username"] != "") {
        $username = htmlEncode2($net2ftp_globals["username"]);
    } else {
        $username = htmlEncode2($net2ftp_globals["cookie_username"]);
    }
    // ------------------------------------
    // Password
    // ------------------------------------
    // Do not prefill this field
    $password = "";
    // ------------------------------------
    // Passive mode
    // ------------------------------------
    if ($net2ftp_globals["passivemode"] == "yes") {
        $passivemode["checked"] = "checked=\"checked\"";
    } elseif ($net2ftp_globals["cookie_passivemode"] == "yes") {
        $passivemode["checked"] = "checked=\"checked\"";
    } else {
//.........这里部分代码省略.........
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:101,代码来源:login.inc.php


示例9: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the new directory screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
    if (isset($_POST["newNames"]) == true) {
        $newNames = validateEntry($_POST["newNames"]);
    } else {
        $newNames = "";
    }
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Title
    $title = __("Create new directories");
    // Form name, back and forward buttons
    $formname = "NewDirForm";
    $back_onclick = "document.forms['" . $formname . "'].state.value='browse';document.forms['" . $formname . "'].state2.value='main';document.forms['" . $formname . "'].submit();";
    $forward_onclick = "document.forms['" . $formname . "'].submit();";
    // -------------------------------------------------------------------------
    // Variables for screen 1
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["screen"] == 1) {
        // Next screen
        $nextscreen = 2;
    } elseif ($net2ftp_globals["screen"] == 2) {
        // Open connection
        setStatus(2, 10, __("Connecting to the FTP server"));
        $conn_id = ftp_openconnection();
        if ($net2ftp_result["success"] == false) {
            return false;
        }
        // Create new directories
        setStatus(4, 10, __("Processing the entries"));
        for ($k = 1; $k <= sizeof($newNames); $k++) {
            if (strlen($newNames[$k]) > 0) {
                $newsubdir = glueDirectories($net2ftp_globals["directory"], $newNames[$k]);
                ftp_newdirectory($conn_id, $newsubdir);
                if ($net2ftp_result["success"] == false) {
                    setErrorVars(true, "", "", "", "");
                    // Continue anyway
                    $net2ftp_output["newdir"][] = __("Directory <b>%1\$s</b> could not be created.", htmlEncode2($newNames[$k]));
                } else {
                    $net2ftp_output["newdir"][] = __("Directory <b>%1\$s</b> was successfully created.", htmlEncode2($newNames[$k]));
                }
            }
            // End if
        }
        // End for
        // Close connection
        ftp_closeconnection($conn_id);
    }
    // end elseif
    // -------------------------------------------------------------------------
    // Print the output
    // -------------------------------------------------------------------------
    require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php";
}
开发者ID:NN-Dev-Team,项目名称:Nordic-Network,代码行数:62,代码来源:newdir.inc.php


示例10: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
    if (isset($_POST["troubleshoot_ftpserver"]) == true) {
        $troubleshoot_ftpserver = validateFtpserver($_POST["troubleshoot_ftpserver"]);
    } else {
        $troubleshoot_ftpserver = "";
    }
    if (isset($_POST["troubleshoot_ftpserverport"]) == true) {
        $troubleshoot_ftpserverport = validateFtpserverport($_POST["troubleshoot_ftpserverport"]);
    } else {
        $troubleshoot_ftpserverport = "";
    }
    if (isset($_POST["troubleshoot_username"]) == true) {
        $troubleshoot_username = validateUsername($_POST["troubleshoot_username"]);
    } else {
        $troubleshoot_username = "";
    }
    if (isset($_POST["troubleshoot_password"]) == true) {
        $troubleshoot_password = validatePassword($_POST["troubleshoot_password"]);
    } else {
        $troubleshoot_password = "";
    }
    if (isset($_POST["troubleshoot_directory"]) == true) {
        $troubleshoot_directory = validateDirectory($_POST["troubleshoot_directory"]);
    } else {
        $troubleshoot_directory = "";
    }
    if (isset($_POST["troubleshoot_passivemode"]) == true) {
        $troubleshoot_passivemode = validatePassivemode($_POST["troubleshoot_passivemode"]);
    } else {
        $troubleshoot_passivemode = "";
    }
    $troubleshoot_ftpserver_html = htmlEncode2($troubleshoot_ftpserver);
    $troubleshoot_ftpserverport_html = htmlEncode2($troubleshoot_ftpserverport);
    $troubleshoot_username_html = htmlEncode2($troubleshoot_username);
    $troubleshoot_directory_html = htmlEncode2($troubleshoot_directory);
    $troubleshoot_passivemode_html = htmlEncode2($troubleshoot_passivemode);
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Title
    $title = __("Troubleshoot an FTP server");
    // Form name
    $formname = "AdvancedForm";
    // -------------------------------------------------------------------------
    // Variables for screen 1
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["screen"] == 1) {
        // Next screen
        $nextscreen = 2;
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='advanced';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
        $forward_onclick = "document.forms['" . $formname . "'].submit();";
    } elseif ($net2ftp_globals["screen"] == 2) {
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='advanced_ftpserver'; document.forms['" . $formname . "'].submit();";
        // Initial checks
        if ($troubleshoot_passivemode != "yes") {
            $troubleshoot_passivemode = "no";
        }
        // Connect
        setStatus(1, 10, __("Connecting to the FTP server"));
        $conn_id = ftp_connect("{$troubleshoot_ftpserver}", $troubleshoot_ftpserverport);
        // Login with username and password
        setStatus(2, 10, __("Logging into the FTP server"));
        $ftp_login_result = ftp_login($conn_id, $troubleshoot_username, $troubleshoot_password);
        // Passive mode
        if ($troubleshoot_passivemode == "yes") {
            setStatus(3, 10, __("Setting the passive mode"));
            $ftp_pasv_result = ftp_pasv($conn_id, TRUE);
        } else {
            $ftp_pasv_result = true;
        }
        // Get the FTP system type
        setStatus(4, 10, __("Getting the FTP system type"));
        $ftp_systype_result = ftp_systype($conn_id);
        // Change the directory
        setStatus(5, 10, __("Changing the directory"));
        $ftp_chdir_result = ftp_chdir($conn_id, $troubleshoot_directory);
        // Get the current directory from the FTP server
        setStatus(6, 10, __("Getting the current directory"));
        $ftp_pwd_result = ftp_pwd($conn_id);
        // Try to get a raw list
        setStatus(7, 10, __("Getting the list of directories and files"));
        $ftp_rawlist_result = ftp_rawlist($conn_id, "-a");
        if (sizeof($ftp_rawlist_result) <= 1) {
            $ftp_rawlist_result = ftp_rawlist($conn_id, "");
        }
        // Parse the list
        setStatus(8, 10, __("Parsing the list of directories and files"));
        for ($i = 0; $i < sizeof($ftp_rawlist_result); $i++) {
            $parsedlist[$i] = ftp_scanline($troubleshoot_directory, $ftp_rawlist_result[$i]);
        }
//.........这里部分代码省略.........
开发者ID:jprice,项目名称:EHCP,代码行数:101,代码来源:advanced_ftpserver.inc.php


示例11: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    if (isset($_POST["input_admin_username"]) == true) {
        $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"]));
    } else {
        $input_admin_username = "";
    }
    if (isset($_POST["input_admin_password"]) == true) {
        $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"]));
    } else {
        $input_admin_password = "";
    }
    if (isset($_POST["dbusername2"]) == true) {
        $dbusername2 = validateUsername($_POST["dbusername2"]);
    } else {
        $dbusername2 = "";
    }
    if (isset($_POST["dbpassword2"]) == true) {
        $dbpassword2 = validatePassword($_POST["dbpassword2"]);
    } else {
        $dbpassword2 = "";
    }
    if (isset($_POST["dbname2"]) == true) {
        $dbname2 = validateGenericInput($_POST["dbname2"]);
    } else {
        $dbname2 = "";
    }
    if (isset($_POST["dbserver2"]) == true) {
        $dbserver2 = validateGenericInput($_POST["dbserver2"]);
    } else {
        $dbserver2 = "";
    }
    $dbusername2_html = htmlEncode2($dbusername2);
    $dbpassword2_html = htmlEncode2($dbpassword2);
    $dbname2_html = htmlEncode2($dbname2);
    $dbserver2_html = htmlEncode2($dbserver2);
    if ($dbserver2 == "") {
        $dbserver2 = "localhost";
    }
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Output variable
    $net2ftp_output["admin_createtables"][] = "";
    // Title
    $title = __("Admin functions");
    // Form name
    $formname = "AdminForm";
    // Read the SQL file
    $filename = glueDirectories($net2ftp_globals["application_rootdir"], "create_tables.sql");
    $handle = fopen($filename, "rb");
    // Open the file for reading only
    if ($handle == false) {
        $net2ftp_output["admin_createtables"][] = __("The handle of file %1\$s could not be opened.", $filename);
    }
    clearstatcache();
    // for filesize
    $sqlquerystring = fread($handle, filesize($filename));
    if ($sqlquerystring == false) {
        $net2ftp_output["admin_createtables"][] = __("The file %1\$s could not be opened.", $filename);
    }
    $result1 = fclose($handle);
    if ($result1 == false) {
        $net2ftp_output["admin_createtables"][] = __("The handle of file %1\$s could not be closed.", $filename);
    }
    // Split the SQL file in individual queries
    $sqlquerypieces = explode("\n", $sqlquerystring);
    // -------------------------------------------------------------------------
    // Variables for screen 1
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["screen"] == 1) {
        // Next screen
        $nextscreen = 2;
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
        $forward_onclick = "document.forms['" . $formname . "'].submit();";
    } elseif ($net2ftp_globals["screen"] == 2) {
        // Next screen
        $nextscreen = 1;
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
        $dbpassword2_length = strlen($dbpassword2);
        // ------------------------------------
        // Connect
        // ------------------------------------
        $mydb = mysql_connect($dbserver2, $dbusername2, $dbpassword2);
        if ($mydb == false) {
            $net2ftp_output["admin_createtables"][] = __("The connection to the server <b>%1\$s</b> could not be set up. Please check the database settings you've entered.", $dbserver2_html) . "\n";
        }
        // ------------------------------------
        // Select
        // ------------------------------------
        if ($mydb != false) {
//.........这里部分代码省略.........
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:101,代码来源:admin_createtables.inc.php


示例12: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the unzip screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
    if (isset($_POST["list"]) == true) {
        $list = getSelectedEntries($_POST["list"]);
    } else {
        $list = "";
    }
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------- 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP htmlEnt函数代码示例发布时间:2022-05-15
下一篇:
PHP htmlDisplayError函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap