当前位置: 首页>>代码示例>>PHP>>正文


PHP html_safe函数代码示例

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


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

示例1: filltext

function filltext($x)
{
    global $fill;
    if ($fill) {
        return html_safe(stripslashes($_POST[$x]));
    }
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:7,代码来源:quiz_pages.php

示例2: create_birth_or_death_data

function create_birth_or_death_data($bd, $sql_row)
{
    $res = '<date year="' . $sql_row[$bd . 'year'] . '" month="' . $sql_row[$bd . 'month'] . '" day="' . $sql_row[$bd . 'day'];
    if ($sql_row[$bd . 'comments'] != '') {
        $res .= '" comments="' . html_safe($sql_row[$bd . 'comments']);
    }
    $res .= "\" />\n";
    return $res;
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:9,代码来源:authorxml.php

示例3: decode_line

 function decode_line($type, $result, $inputtype)
 {
     $res = "<tr><td class='colFit'>" . $type . "</td><td>";
     if ($inputtype == 'input') {
         $res .= "<input type='text' value='" . html_safe($result) . "' ondblclick='this.select();'>";
     } else {
         $res .= "<textarea style='height:80px;min-height:80px;' ondblclick='this.select();'>" . html_safe($result) . "</textarea>";
     }
     return $res;
 }
开发者ID:lionsoft,项目名称:b374k,代码行数:10,代码来源:convert.php

示例4: mysql_query

            $smsg = "";
        }
    }
}
//save server settings
if (isset($_POST["save"])) {
    $query = mysql_query("UPDATE `" . $config->db_prefix . "_serverinfo` SET \n\t\t\t\t\t`rcon`='" . sql_safe($_POST["rcon"]) . "',\n\t\t\t\t\t`amxban_motd`='" . sql_safe($_POST["amxban_motd"]) . "',\n\t\t\t\t\t`motd_delay`='" . (int) $_POST["motd_delay"] . "',\n\t\t\t\t\t`amxban_menu`='" . (int) $_POST["amxban_menu"] . "',\n\t\t\t\t\t`reasons`='" . (int) $_POST["reasons"] . "',\n\t\t\t\t\t`timezone_fixx`='" . (int) $_POST["timezone_fixx"] . "'\n\t\t\t\t\tWHERE `id`=" . $sid . " LIMIT 1") or die(mysql_error());
    $user_msg = '_SERVERSAVED';
    log_to_db("Server config", "Edited server: " . html_safe($_POST["sidname"]));
}
//delete server from db
if (isset($_POST["del"])) {
    $query = mysql_query("DELETE FROM `" . $config->db_prefix . "_serverinfo` WHERE `id`=" . $sid . " LIMIT 1") or die(mysql_error());
    $query = mysql_query("DELETE FROM `" . $config->db_prefix . "_admins_servers` WHERE `server_id`=" . $sid) or die(mysql_error());
    $user_msg = '_SERVERDELETED';
    log_to_db("Server config", "Deleted server: " . html_safe($_POST["sidname"]));
}
//get servers
$servers = sql_get_server();
//get reason sets
$query = mysql_query("SELECT * FROM `" . $config->db_prefix . "_reasons_set` ORDER BY `setname` ASC") or die(mysql_error());
$reasons_values = array("");
$reasons_choose = array("");
while ($result = mysql_fetch_object($query)) {
    $reasons_values[] = $result->id;
    $reasons_choose[] = $result->setname;
}
$timezone_values = array(-12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
$timezone_output = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12");
$delay_choose = array(2, 3, 4, 5, 7, 10);
$menu_choose = array(0, 1);
开发者ID:GoeGaming,项目名称:bans.sevenelevenclan.org,代码行数:31,代码来源:admin_sm_sv.php

示例5: make_output

function make_output()
{
    $out .= '$' . ssqs($_SESSION['quiz_data']['quiz_id']) . " = new Quiz(\n";
    $out .= ' "' . ssqs($_SESSION['quiz_data']['quiz_id']) . "\",\n";
    $out .= ' _("' . ssqs($_SESSION['quiz_data']['quiz_name']) . "\"),\n";
    $out .= ' _("' . ssqs($_SESSION['quiz_data']['short_quiz_name']) . "\"),\n";
    $out .= ' _("' . ssqs($_SESSION['quiz_data']['description']) . "\"),\n";
    global $forums_url;
    if ($_SESSION['quiz_data']['thread'] != '') {
        $_SESSION['quiz_data']['thread'] = str_replace($forums_url, '$forums_url', $_SESSION['quiz_data']['thread']);
    }
    $out .= ' "' . ssqs($_SESSION['quiz_data']['thread']) . "\",\n";
    $out .= " array(\n";
    $pages = array();
    foreach ($_SESSION['quiz_data']['pages'] as $quiz_page_id => $details) {
        $pages[] = '  _("' . ssqs($details) . '") => "' . ssqs($quiz_page_id) . "\"";
    }
    $out .= implode(",\n", $pages);
    $out .= "),\n";
    $out .= " array(\n  'maximum_age' => 15778463) // 6 months\n);\n";
    return html_safe($out);
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:22,代码来源:output_quiz.php

示例6: mysql_fetch_object

            echo "<td>{$qd->comment}</td>\n";
        }
        echo "</tr>\n";
        $rownum++;
    }
    echo "</table>\n";
    echo "<br>\n";
} else {
    $qd = mysql_fetch_object(mysql_query("\n        SELECT *\n        FROM queue_defns\n        WHERE round_id='{$round_id}' AND name='{$name}'\n    "));
    if (!$qd) {
        die(html_safe("No such release queue '{$name}' in {$round_id}."));
    }
    $cooked_project_selector = cook_project_selector($qd->project_selector);
    $comment = $qd->comment;
    //// TRANSLATORS: %s is the name of this release queue.
    $title = sprintf(_("\"%s\" Release Queue"), html_safe($name));
    $title = preg_replace('/(\\\\)/', "", $title);
    // Unescape apostrophes, etc.
    // Suppress stats since this page is very wide
    output_header($title, NO_STATSBAR);
    echo "<br><h2>{$title}</h2>";
    if ($user_can_see_queue_settings) {
        echo "<h4>", _("project_selector"), ": {$qd->project_selector}</h4>\n\n";
        if ($cooked_project_selector != $qd->project_selector) {
            echo "({$cooked_project_selector})\n\n";
        }
        echo "<h4>{$comment}</h4>\n";
    }
    // Add Back to to Release Queues link
    echo "<p><a href='" . $code_url . "/stats/release_queue.php?round_id={$round_id}'>" . _("Back to Release Queues") . "</a></p>\n";
    $comments_url1 = mysql_escape_string("<a href='{$code_url}/project.php?id=");
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:release_queue.php

示例7: require_login

include_once 'menu.inc';
require_login();
$title = _("Manage biographies");
output_header($title);
abort_if_not_authors_db_manager();
if ($_SERVER['QUERY_STRING'] == '') {
    echo "<script language='JavaScript'><!--\nlocation.href='?reload';\n";
    echo "document.open();\ndocument.write('Please <a href=\"?reload\">continue</a>.');\ndocument.close();\n--></script>\n";
    echo '<noscript>Please note that you need to have JavaScript turned on in order to use this page.</noscript>';
    exit;
}
echo_menu();
echo "<h2 align='center'>{$title}</h2>";
$message = @$_GET['message'];
if (isset($message)) {
    echo '<center>' . html_safe($message) . '</center><br />';
}
if (isset($_POST) && count($_POST) > 0) {
    // find out what to do -- store in different 'queues'
    $delete_bios = array();
    $move_bios = array();
    $delete_authors = array();
    $enable_author_values = array();
    $enable_author_ids = array();
    if (isset($_POST['move_to_author'])) {
        $moveTo = $_POST['move_to_author'];
    }
    // loop through posted data, see what the field names start with, save ids in arrays
    reset($_POST);
    while (list($key, $val) = each($_POST)) {
        if (strpos($key, 'delete_bio_') !== false) {
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:manage.php

示例8: do_postcomments

function do_postcomments()
{
    global $project, $code_url;
    if ($project->state != PROJ_POST_FIRST_CHECKED_OUT) {
        return;
    }
    $projectid = $project->projectid;
    if ($project->PPer_is_current_user) {
        echo "<h4>" . _("Post-Processor's Comments") . "</h4>";
        echo_postcomments_instructions();
        echo "<form name='pp_update' method='post' action='{$code_url}/tools/post_proofers/postcomments.php'>\n";
        echo "<textarea name='postcomments' cols='60' rows='6'>\n";
        echo html_safe($project->postcomments);
        echo "</textarea>\n";
        echo "<input type='hidden' name='projectid' value='{$projectid}' />\n";
        echo "<br /><input type='submit' value='" . attr_safe(_('Update comment and project status')) . "'/>";
        echo "</form>\n";
    }
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:19,代码来源:project.php

示例9: dropdown_select_values_and_labels

function dropdown_select_values_and_labels($field_name, $current_value, $values, $labels, $on_change = '')
{
    global $event_id, $window_onload_event;
    $function_name = 'event' . ++$event_id;
    $jscode = "var f=document.forms[0];\nvar t=f.{$field_name};\n{$on_change}";
    echo "<script type='text/javascript'><!--\nfunction {$function_name}() { {$jscode} }\n--></script>\n";
    echo "<select name='{$field_name}' ID='{$field_name}' onChange=\"{$function_name}()\">";
    for ($i = 0; $i < count($values); $i++) {
        echo "<option value='{$values[$i]}'";
        if ($current_value == $values[$i]) {
            echo " SELECTED";
        }
        echo ">" . html_safe($labels[$i]) . "</option>";
    }
    echo "</select>";
    $window_onload_event .= "{$function_name}();\n";
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:17,代码来源:userprefs.php

示例10: confirm_is_local

function confirm_is_local($type, $item_name)
{
    global $curr_abspath, $hce_curr_displaypath;
    assert($type == 'F' || $type == 'D' || $type == 'FD');
    // NB this catches $item_name == NULL too
    if ($item_name == '') {
        fatal_error(_("Item name must not be empty."));
    }
    if (strpos($item_name, '/') !== FALSE) {
        fatal_error(_("Item name must not contain a slash character"));
    }
    $src_path = "{$curr_abspath}/{$item_name}";
    // Note that 'file_exists', despite the name, doesn't require
    // that its arg identify a file (as opposed to a directory).
    if (!file_exists($src_path)) {
        fatal_error(sprintf(_('folder %1$s does not have an item named %2$s'), $hce_curr_displaypath, html_safe($item_name)));
    }
    if ($type == 'FD') {
        return;
    }
    if ($type == 'F') {
        $exists = is_file($src_path);
        $msg = _("%s exists, but is not a file");
    } else {
        if ($type == 'D') {
            $exists = is_dir($src_path);
            $msg = _("%s exists, but is not a folder");
        } else {
            assert(FALSE);
        }
    }
    if (!$exists) {
        fatal_error(sprintf($msg, html_safe($item_name)));
    }
}
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:35,代码来源:remote_file_manager.php

示例11: mysql_real_escape_string

if (isset($_POST["username"]) && $_POST["username"] != "---") {
    $username = mysql_real_escape_string($_POST["username"]);
    $filter = "`username`='" . $username . "'";
    $smarty->assign("username_checked", $username);
}
if (isset($_POST["action"]) && $_POST["action"] != "---") {
    $action = mysql_real_escape_string($_POST["action"]);
    $filter .= $filter ? " AND " : "";
    $filter .= "`action`='" . $action . "'";
    $smarty->assign("action_checked", $action);
}
$logs = sql_get_logs($filter);
$smarty->assign("logs", $logs);
//get all usernames
$query = mysql_query("SELECT * FROM `" . $config->db_prefix . "_logs` GROUP BY `username` ORDER BY `id`") or die(mysql_error());
$usernames["---"] = "---";
while ($result = mysql_fetch_object($query)) {
    if ($result->username != "") {
        $usernames[html_safe($result->username)] = html_safe($result->username);
    }
}
$smarty->assign("usernames", $usernames);
//get all actions
$query = mysql_query("SELECT * FROM `" . $config->db_prefix . "_logs` GROUP BY `action` ORDER BY `id`") or die(mysql_error());
$actions["---"] = "---";
while ($result = mysql_fetch_object($query)) {
    if ($result->action != "") {
        $actions[html_safe($result->action)] = html_safe($result->action);
    }
}
$smarty->assign("actions", $actions);
开发者ID:GoeGaming,项目名称:bans.sevenelevenclan.org,代码行数:31,代码来源:admin_so_lg.php

示例12: str_replace

<?php

$error = @ob_get_contents();
$error_html = !empty($error) ? "<pre class='phpError border'>" . str_replace("\n\n", "\n", html_safe($error)) . "</pre>" : "";
@ob_end_clean();
error_reporting(0);
@ini_set('display_errors', '0');
?>
<!doctype html>
<html>
<head>
<title><?php 
echo $GLOBALS['title'] . " " . $GLOBALS['ver'];
?>
</title>
<meta charset='utf-8'>
<meta name='robots' content='noindex, nofollow, noarchive'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0">
<link rel='SHORTCUT ICON' href='<?php 
echo get_resource('b374k');
?>
'>
<style type="text/css">
<__CSS__>
#navigation{position:fixed;left:-16px;top:46%;}
#totop,#tobottom,#toggleBasicInfo{background:url('<?php 
echo get_resource('arrow');
?>
');width:32px;height:32px;opacity:0.30;margin:18px 0;cursor:pointer;}
#totop:hover,#tobottom:hover{opacity:0.80;}
#toggleBasicInfo{display:none;float:right;margin:0;}
开发者ID:lionsoft,项目名称:b374k,代码行数:31,代码来源:layout.php

示例13: flushGroup

 /**
  * @param string $new_tag
  */
 private function flushGroup($new_tag)
 {
     if ($this->group !== '') {
         if ($this->tag == 'ins') {
             $this->line .= "<ins{$this->insClass}>" . html_safe($this->group) . '</ins>';
         } elseif ($this->tag == 'del') {
             $this->line .= "<del{$this->delClass}>" . html_safe($this->group) . '</del>';
         } else {
             $this->line .= html_safe($this->group);
         }
     }
     $this->group = '';
     $this->tag = $new_tag;
 }
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:17,代码来源:DairikiDiff.php

示例14: _

            $query = "INSERT INTO authors " . "(last_name, other_names, byear, bmonth, bday, dyear, dmonth, dday, bcomments, dcomments, enabled)\n" . "VALUES('{$last_name}', '{$other_names}', {$date_fields_str} '', '', 'no')";
            if ($simulating) {
                echo "<font color='red'>    " . _("The following query would have been run:") . "\n      " . str_replace("\n", "\n      ", html_safe($query)) . "</font>\n";
                $author_id = '#new author id#';
            } else {
                $store_result = mysql_query($query);
                if (!$store_result) {
                    echo '    ' . _("An error occurred while saving the author:") . ' ' . mysql_error() . "\n";
                    exit;
                }
                $author_id = mysql_insert_id();
                echo '    ' . sprintf(_("The author was inserted into the database with the id %d."), $author_id) . "\n";
            }
            $query = "INSERT INTO biographies " . "(author_id, bio) " . "VALUES({$author_id}, '{$bio}');";
            if ($simulating) {
                echo "<font color='blue'>    " . _("The following query would have been run:") . "\n      " . str_replace("\n", "\n      ", html_safe($query)) . "</font>\n";
            } else {
                $store_result = mysql_query($query);
                if (!$store_result) {
                    echo '    ' . _("An error occurred while saving the biography:") . ' ' . mysql_error() . "\n";
                    exit;
                }
                echo '    ' . sprintf(_("The biography was inserted into the database with the id %d."), mysql_insert_id()) . "\n\n";
            }
        }
    }
    echo "\n" . _("Done. All projects searched.");
}
function ensure_digits($digits_or_question_mark)
{
    return $digits_or_question_mark == '?' ? 0 : $digits_or_question_mark;
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:harvest.php

示例15: output

        output($counter);
    }
    output('error');
} elseif (isset($p['viewFileorFolder'])) {
    $entry = $p['viewFileorFolder'];
    if (is_file($entry)) {
        output('file');
    } elseif (is_dir($entry)) {
        output('folder');
    }
    output('error');
} elseif (isset($p['terminalInput'])) {
    output(html_safe(execute($p['terminalInput'])));
} elseif (isset($p['evalInput']) && isset($p['evalType'])) {
    $evalInput = $p['evalInput'];
    $evalOptions = isset($p['evalOptions']) ? $p['evalOptions'] : "";
    $evalArguments = isset($p['evalArguments']) ? $p['evalArguments'] : "";
    $evalType = $p['evalType'];
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
    @ini_set('html_errors', '0');
    @ini_set('display_errors', '1');
    @ini_set('display_startup_errors', '1');
    $res = eval_go($evalType, $evalInput, $evalOptions, $evalArguments);
    if ($res === false) {
        $res == "error";
    }
    output(html_safe($res));
} elseif (isset($p['evalGetSupported'])) {
    $res = eval_get_supported();
    output($res);
}
开发者ID:lionsoft,项目名称:b374k,代码行数:31,代码来源:base.php


注:本文中的html_safe函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。