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


PHP htmlent_utf8函数代码示例

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


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

示例1: gradeShowInfo

function gradeShowInfo($row)
{
    echo '<p><a href="grades.php">Back to All Grades</a>' . "</p><p>\n";
    echo "User Name: " . htmlent_utf8($row['displayname']) . "<br/>\n";
    echo "User Email: " . htmlent_utf8($row['email']) . "<br/>\n";
    echo "Last Submision: " . htmlent_utf8($row['updated_at']) . "<br/>\n";
    echo "Score: " . htmlent_utf8($row['grade']) . "<br/>\n";
    echo "</p>\n";
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:9,代码来源:lib.php

示例2: var_dump_pre

function var_dump_pre($variable, $print = true)
{
    ob_start();
    var_dump($variable);
    $result = ob_get_clean();
    if ($print) {
        print htmlent_utf8($result);
    }
    return $result;
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:10,代码来源:util.php

示例3: htmlentities

<form method="post">
Service URL: <input type="text" name="content_item_return_url" size="120" value="<?php 
echo htmlentities($result_url);
?>
"/></br>
OAuth Consumer Key: <input type="text" name="oauth_consumer_key" size="80" value="<?php 
echo htmlentities($oauth_consumer_key);
?>
"/></br>
OAuth Consumer Secret: <input type="text" name="secret" size="80" value="<?php 
echo htmlentities($oauth_consumer_secret);
?>
"/></br>
<br/>
Content URL to send: </br>
<input type="text" name="content_url" 
size="80" value="<?php 
echo htmlent_utf8($content_url);
?>
"/>
</p><p>
Opaque Data: </br>
<textarea name="data" rows=5 cols=80>
<?php 
echo htmlent_utf8($data);
?>
</textarea>
</p><p>
<input type='submit' name='send' value="Send Content Response">
</form>
开发者ID:amoskarugaba,项目名称:sakai,代码行数:30,代码来源:fileitem_json.php

示例4: success_out

function success_out($output)
{
    echo '<span style="color:green"><strong>' . htmlent_utf8($output) . "</strong></span><br/>\n";
    flush();
}
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:5,代码来源:lms_lib.php

示例5: line_out

<?php

require_once "webauto.php";
use Goutte\Client;
line_out("Grading PHP-Intro Assignment 2");
$url = getUrl('http://csevumich.byethost18.com/howdy.php');
if ($url === false) {
    return;
}
$grade = 0;
error_log("ASSN02 " . $url);
line_out("Retrieving " . htmlent_utf8($url) . "...");
flush();
// http://symfony.com/doc/current/components/dom_crawler.html
$client = new Client();
$crawler = $client->request('GET', $url);
$html = $crawler->html();
$OUTPUT->togglePre("Show retrieved page", $html);
line_out("Searching for h1 tag...");
$passed = 0;
$titlefound = false;
try {
    $h1 = $crawler->filter('h1')->text();
    line_out("Found h1 tag...");
} catch (Exception $ex) {
    error_out("Did not find h1 tag");
    $h1 = "";
}
if (stripos($h1, 'Hello') !== false) {
    success_out("Found 'Hello' in the h1 tag");
    $passed += 1;
开发者ID:ixtel,项目名称:tsugi,代码行数:31,代码来源:a02.php

示例6: updateForm

 /**
  *  Generate the HTML for an update form.
  *
  * Here is a sample call:
  *
  *     $from_location = "keys.php";
  *     $fields = array("key_key", "key_sha256", "secret", "created_at", "updated_at");
  *     $current = getCurrentFileUrl(__FILE__);
  *     $retval = CrudForm::updateForm($row, $fields, $current, $from_location, true, true);
  *
  * @param $row The existing data for the fields.
  * @param $fields An array of fields to be shown.
  * @param $current The URL of the current HTML page.
  * @param $from_location A URL to jump to when the user presses 'Cancel'.
  * @param $allow_edit True/false as to whether to show an Edit button
  * @param $allow_delete True/false as to whether to show a Delete button
  * @param $extra_buttons An array of additional buttons to show
  */
 public static function updateForm($row, $fields, $current, $from_location, $allow_edit = false, $allow_delete = false, $extra_buttons = false)
 {
     $key = $fields['0'];
     if (!isset($_REQUEST[$key])) {
         return "Required {$key}= parameter";
     }
     $key_value = $_REQUEST[$key] + 0;
     $do_edit = isset($_REQUEST['edit']) && $_REQUEST['edit'] == 'yes';
     echo '<form method="post">' . "\n";
     echo '<a href="' . $from_location . '" class="btn btn-default">' . _m('Exit') . '</a>' . "\n";
     if ($allow_edit) {
         if ($do_edit) {
             echo '<input type="submit" name="doUpdate" class="btn btn-normal" value="' . _m("Update") . '">' . "\n";
             echo '<a href="' . $current . '?' . $key . '=' . $key_value . '" class="btn btn-success">' . _m("Cancel Edit") . '</a>' . "\n";
         } else {
             echo '<a href="' . $current . '?' . $key . '=' . $key_value . '&edit=yes" class="btn btn-warning">' . _m("Edit") . '</a>' . "\n";
         }
     }
     if (is_array($extra_buttons)) {
         foreach ($extra_buttons as $button_text => $button_url) {
             echo '<a href="' . $button_url . '" class="btn btn-success">' . _m($button_text) . '</a>' . "\n";
         }
     }
     if ($allow_delete) {
         echo '<input type="hidden" name="' . $key . '" value="' . $key_value . '">' . "\n";
         echo '<input type="submit" name="doDelete" class="btn btn-danger" value="' . _m("Delete") . '"';
         echo " onclick=\"return confirm('Are you sure you want to delete this record?');\">\n";
     }
     echo "<p>\n";
     for ($i = 0; $i < count($fields); $i++) {
         $field = $fields[$i];
         $value = $row[$field];
         if (!$do_edit) {
             echo '<p><strong>' . self::fieldToTitle($field) . "</strong></p>\n";
             if (strpos($field, "secret") !== false) {
                 echo "<p onclick=\"\$('#stars_{$i}').toggle();\$('#text_{$i}').toggle();\">\n";
                 echo "<span id=\"stars_{$i}\">***********</span>\n";
                 echo "<span style=\"display: none;\" id=\"text_{$i}\">" . htmlent_utf8($value) . '</span>';
                 echo "\n</p>\n";
             } else {
                 echo "<p>" . htmlent_utf8($value) . "</p>\n";
             }
             continue;
         }
         if ($i == 0 && strpos($field, "_id") !== false) {
             echo '<input type="hidden" name="' . $field . '" value="' . htmlent_utf8($value) . '">' . "\n";
             continue;
         }
         // Don't allow explicit updating of these fields
         if (strpos($field, "_at") > 0) {
             continue;
         }
         echo '<div class="form-group">' . "\n";
         echo '<label for="' . $field . '">' . self::fieldToTitle($field) . "<br/>\n";
         if (isset($_POST[$field])) {
             $value = $_POST[$field];
         }
         if (strpos($field, "secret") !== false) {
             echo '<input id="' . $field . '" type="password" size="80" name="' . $field . '" value="' . htmlent_utf8($value) . '"';
             echo "onclick=\"if ( \$(this).attr('type') == 'text' ) \$(this).attr('type','password'); else \$(this).attr('type','text'); return false;\">\n";
         } else {
             if (strlen($value) > 60) {
                 echo '<textarea rows="10" cols="70" id="' . $field . '" name="' . $field . '">' . htmlent_utf8($value) . '</textarea>' . "\n";
             } else {
                 echo '<input type="text" size="80" id="' . $field . '" name="' . $field . '" value="' . htmlent_utf8($value) . '">' . "\n";
             }
         }
         echo "</label>\n</div>";
     }
     echo '</form>' . "\n";
     return true;
 }
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:90,代码来源:CrudForm.php

示例7: array

require_once $CFG->dirroot . "/pdo.php";
require_once $CFG->dirroot . "/lib/lms_lib.php";
use Tsugi\Core\LTIX;
// Sanity checks
$LTI = LTIX::requireData();
$p = $CFG->dbprefix;
// The reset operation is a normal POST - not AJAX
if ($USER->instructor && isset($_POST['reset'])) {
    $PDOX->queryDie("DELETE FROM {$p}rps WHERE link_id = :LI", array(':LI' => $LINK->id));
    header('Location: ' . addSession('index.php'));
    return;
}
?>
<html><head><title><?php 
_e("Playing Rock Paper Scissors in");
echo htmlent_utf8($CONTEXT->title);
?>
</title>
<script type="text/javascript"
src="<?php 
echo $CFG->staticroot;
?>
/static/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  window.console && console.log('Hello JQuery..');
  $("#rock").click( function() { play(0); } ) ;
  $("#paper").click( function() { play(1); } ) ;
  $("#scissors").click( function() { play(2); } ) ;
});
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:30,代码来源:index.php

示例8: htmlent_utf8

</p>
  <div class="control-group pull-right hidden-phone">
      <button type="submit" style="margin-top: 40px" class="btn btn-primary">Save Profile Data</button>
  </div>

  <div id="map_canvas" style="margin: 10px; width:400px; max-width: 100%; height:400px"></div>

  <div id="latlong" style="display:none" class="control-group">
    <p>Latitude: <input size="30" type="text" id="latbox" name="lat" class="disabled"
    <?php 
    echo ' value="' . htmlent_utf8($lat) . '" ';
    ?>
    ></p>
    <p>Longitude: <input size="30" type="text" id="lngbox" name="lng" class="disabled"
    <?php 
    echo ' value="' . htmlent_utf8($lng) . '" ';
    ?>
    ></p>
  </div>

<p>
If you don't even want to reveal your country, put yourself
in Greenland in the middle of a glacier. One person put their location
in the middle of a bar.  :)
</p>
<?php 
}
?>
</form>
<?php 
// After jquery gets loaded at the *very* end...
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:profile.php

示例9: getFolderName

// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->flashMessages();
$OUTPUT->welcomeUserCourse();
$foldername = getFolderName();
if (!file_exists($foldername)) {
    mkdir($foldername);
}
$stmt = $PDOX->prepare("SELECT file_id, file_name FROM {$p}sample_blob\n        WHERE context_id = :CI");
$stmt->execute(array(":CI" => $CONTEXT->id));
$count = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $id = $row['file_id'];
    $fn = $row['file_name'];
    echo '<li><a href="blob_serve.php?id=' . $id . '" target="_new">' . htmlent_utf8($fn) . '</a>';
    if ($USER->instructor) {
        echo ' (<a href="blob_delete.php?id=' . $id . '">Delete</a>)';
    }
    echo '</li>';
    $count++;
}
if ($count == 0) {
    echo "<p>No Files Found</p>\n";
}
echo "</ul>\n";
if ($USER->instructor) {
    ?>
<h4>Upload file (max <?php 
    echo maxUpload();
    ?>
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:index.php

示例10: name

        <form id="prefs_form">
            <?php 
    if ($firstname === false) {
        ?>
                <input type="checkbox" name="allow_first" style="display:hidden">
            <?php 
    } else {
        ?>
                <input type="checkbox" name="allow_first" <?php 
        if ($row['first'] == 1) {
            echo "checked";
        }
        ?>
            >
            Share your first name (<?php 
        echo htmlent_utf8($firstname);
        ?>
) on the map<br/>
            <?php 
    }
    ?>
            <input type="checkbox" name="allow_name" <?php 
    if (!isset($USER->displayname)) {
        echo ' style="display:hidden"';
    } else {
        if ($row['name'] == 1) {
            echo "checked";
        }
    }
    ?>
            >
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:index.php

示例11: foreach

            echo "<th>Action</th>";
        }
        echo "</tr>\n";
        $max_points = false;
        foreach ($our_grades as $grade) {
            if ($assn_json->peerpoints > 0) {
                if ($max_points === false) {
                    $max_points = $grade['points'];
                }
                $show = $grade['points'];
                if ($show < $max_points) {
                    $show = '';
                }
                echo "<tr><td>" . $show . "</td>";
            }
            echo "<td>" . htmlent_utf8($grade['note']) . "</td>\n";
            if ($assn_json->flag) {
                echo '<td><form><input type="submit" name="showFlag" value="Flag"' . 'onclick="$(\'#flag_grade_id\').val(\'' . $grade['grade_id'] . '\'); $(\'#flagform\').toggle(); return false;" class="btn btn-danger">' . '</form></td>';
            }
            echo "</tr>\n";
        }
        echo "</table>\n";
        if ($max_points !== false) {
            echo "<p>Your overall score from your peers: {$max_points} </p>\n";
        }
    }
}
$OUTPUT->exitButton();
?>
<form method="post" id="flagform" style="display:none">
<p>&nbsp;</p>
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:index.php

示例12: session_start

<?php

require_once "../../config.php";
require_once $CFG->dirroot . "/pdo.php";
require_once $CFG->dirroot . "/lib/lms_lib.php";
require_once $CFG->dirroot . "/core/gradebook/lib.php";
session_start();
// Get the user's grade data also checks session
$row = gradeLoad($_REQUEST['user_id']);
// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->flashMessages();
// Show the basic info for this user
gradeShowInfo($row);
// Unique detail
echo "<p>Submission:</p>\n";
$json = json_decode($row['json']);
if (is_object($json) && isset($json->code)) {
    echo "<pre>\n";
    echo htmlent_utf8($json->code);
    echo "\n";
    echo "</pre>\n";
}
$OUTPUT->footer();
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:25,代码来源:grade-detail.php

示例13: get_body_sent_debug

                    $debugin = get_body_sent_debug();
                    $debugout = get_body_received_debug();
                } else {
                    if (isset($_REQUEST['set_proxy'])) {
                        $postBody = true;
                        $response = sendOAuthBody("PUT", $proxy_url, $oauth_consumer_key, $oauth_consumer_secret, $content_type, $settings);
                        $debugin = get_body_sent_debug();
                        $debugout = get_body_received_debug();
                    } else {
                        exit;
                    }
                }
            }
        }
    }
}
global $LastOAuthBodyBaseString;
$lbs = $LastOAuthBodyBaseString;
ltiUtilTogglePre("Sent Headers", $debugin);
if ($postBody !== false) {
    ltiUtilTogglePre("Our Body Data", indent($settings));
}
ltiUtilTogglePre("Our Base String", $lbs);
ltiUtilTogglePre("Results and Headers", $debugout);
if (strlen($response) < 1) {
    echo "<p>HTTP Response Body empty.</p>\n";
} else {
    echo "<br/><b>Returned data:</b>\n<pre>\n";
    echo htmlent_utf8(indent($response));
    echo "\n</pre>\n";
}
开发者ID:amoskarugaba,项目名称:sakai,代码行数:31,代码来源:settings_json.php

示例14: urlencode

        if ($data) {
            $parms['data'] = $data;
        }
        $parms = LTIX::signParameters($parms, $result_url, "POST", "Install Tool");
        $endform = '<a href="index.php" class="btn btn-warning">Back to Store</a>';
        $content = LTI::postLaunchHTML($parms, $result_url, true, false, $endform);
        echo $content;
    } else {
        echo '<div style="border: 2px, solid, red;" class="card">';
        if ($fa_icon) {
            echo '<a href="index.php?install=' . urlencode($tool) . '">';
            echo '<i class="fa ' . $fa_icon . ' fa-2x" style="color: #1894C7; float:right; margin: 2px"></i>';
            echo '</a>';
        }
        echo '<p><strong>' . htmlent_utf8($title) . "</strong></p>";
        echo '<p>' . htmlent_utf8($text) . "</p>\n";
        echo '<center><a href="index.php?install=' . urlencode($tool) . '" class="btn btn-default" role="button">Details</a></center>';
        echo "</div>\n";
    }
    $toolcount++;
}
echo "</div>\n";
if ($toolcount < 1) {
    lmsDie("No tools to register..");
}
$OUTPUT->footerStart();
// https://github.com/LinZap/jquery.waterfall
if (!$install) {
    ?>
<script type="text/javascript" src="static/waterfall-light.js"></script>
<script>
开发者ID:shaamimahmed,项目名称:tsugi,代码行数:31,代码来源:index.php

示例15: htmlentities

?>
</head>
<body style="font-family:sans-serif; background-color:#add8e6">
<p><b>Calling IMS LTI Content Item Service</b></p>
<?php 
?>
<p>
<form method="post">
Service URL: <input type="text" name="url" size="120" value="<?php 
echo htmlentities($result_url);
?>
"/></br>
OAuth Consumer Key: <input type="text" name="key" size="80" value="<?php 
echo htmlentities($oauth_consumer_key);
?>
"/></br>
OAuth Consumer Secret: <input type="text" name="secret" size="80" value="<?php 
echo htmlentities($oauth_consumer_secret);
?>
"/></br>
</p><p>
Content URL to send: </br>
<input type="text" name="content_url" 
size="80" value="<?php 
echo htmlent_utf8($content_url);
?>
"/>
</p><p>
<input type='submit' name='send' value="Send Content Response">
</form>
开发者ID:philsawa,项目名称:sakai,代码行数:30,代码来源:content_json.php


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