本文整理汇总了PHP中HTMLSpecialChars函数的典型用法代码示例。如果您正苦于以下问题:PHP HTMLSpecialChars函数的具体用法?PHP HTMLSpecialChars怎么用?PHP HTMLSpecialChars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLSpecialChars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Load_Options_Page
public function Load_Options_Page()
{
# Check if the user trys to delete a template
if (isset($_GET['delete']) && $this->core->Get_Template_Properties($_GET['delete'])) {
# You can only delete Fancy Gallery Templates!
Unlink($_GET['delete']);
WP_Redirect($this->Get_Options_Page_Url(array('template_deleted' => 'true')));
} elseif (isset($_GET['delete'])) {
WP_Die(I18n::t('Error while deleting: ' . HTMLSpecialChars($_GET['delete'])));
}
# If the Request was redirected from a "Save Options"-Post
if (isset($_REQUEST['options_saved'])) {
Flush_Rewrite_Rules();
}
# If this is a Post request to save the options
$options_saved = $this->Save_Options();
if ($options_saved) {
WP_Redirect($this->Get_Options_Page_Url(array('options_saved' => 'true')));
}
WP_Enqueue_Script('dashboard');
WP_Enqueue_Style('dashboard');
WP_Enqueue_Script('fancy-gallery-options-page', $this->core->base_url . '/options-page/options-page.js', array('jquery'), $this->core->version, True);
WP_Enqueue_Style('fancy-gallery-options-page', $this->core->base_url . '/options-page/options-page.css');
# Remove incompatible JS Libs
WP_Dequeue_Script('post');
}
示例2: replaceSpecial
function replaceSpecial($str)
{
$str = HTMLSpecialChars($str);
$str = nl2br($str);
$str = str_replace(" ", " ", $str);
$str = str_replace("<? ", "< ?", $str);
$str = str_replace("\n", "<br />", $str);
return $str;
}
示例3: ExecSQL
/**
* Function to parse the SQL
*
* @param string $sSQL The SQL statement to parse
* @return string
*/
function ExecSQL($sSQL)
{
$fToOpen = fsockopen($this->sHostName, $this->nPort, &$errno, &$errstr, 30);
if (!$fToOpen) {
//contruct error string to return
$sReturn = "<?xml version=\"1.0\"?>\r\n<result state=\"failure\">\r\n<error>{$errstr}</error>\r\n</result>\r\n";
} else {
//construct XML to send
//search and replace HTML chars in SQL first
$sSQL = HTMLSpecialChars($sSQL);
$sSend = "<?xml version=\"1.0\"?>\r\n<request>\r\n<connectionstring>{$this->sConnectionString}</connectionstring>\r\n<sql>{$sSQL}</sql>\r\n</request>\r\n";
//write request
fputs($fToOpen, $sSend);
//now read response
while (!feof($fToOpen)) {
$sReturn = $sReturn . fgets($fToOpen, 128);
}
fclose($fToOpen);
}
return $sReturn;
}
示例4: __construct
/**
* Create a view filter. Combine multiple filters together in a api_viewFilters object
*
* @param String $field filter to filter against
* @param String $operator One of the valid operators for filtering. Changes based on the
* field type. Refer to the edit view page in any record to see a list of valid operators
* @param String $value The value to apply to the filter
*/
function __construct($field, $operator, $value)
{
$this->field = $field;
$this->operator = $operator;
$this->value = HTMLSpecialChars($value);
}
示例5: _parseFunc
//.........这里部分代码省略.........
$data = substr($theValue, $pointer, $len);
if (StringUtility::endsWith($data, '/>') && !StringUtility::beginsWith($data, '<link ')) {
$tagContent = substr($data, 1, -2);
} else {
$tagContent = substr($data, 1, -1);
}
$tag = explode(' ', trim($tagContent), 2);
$tag[0] = strtolower($tag[0]);
if ($tag[0][0] === '/') {
$tag[0] = substr($tag[0], 1);
$tag['out'] = 1;
}
if ($conf['tags.'][$tag[0]]) {
$treated = false;
$stripNL = false;
// in-tag
if (!$currentTag && !$tag['out']) {
// $currentTag (array!) is the tag we are currently processing
$currentTag = $tag;
$contentAccumP++;
$treated = true;
// in-out-tag: img and other empty tags
if (preg_match('/^(area|base|br|col|hr|img|input|meta|param)$/i', $tag[0])) {
$tag['out'] = 1;
}
}
// out-tag
if ($currentTag[0] === $tag[0] && $tag['out']) {
$theName = $conf['tags.'][$tag[0]];
$theConf = $conf['tags.'][$tag[0] . '.'];
// This flag indicates, that NL- (13-10-chars) should be stripped first and last.
$stripNL = (bool) $theConf['stripNL'];
// This flag indicates, that this TypoTag section should NOT be included in the nonTypoTag content.
$breakOut = $theConf['breakoutTypoTagContent'] ? 1 : 0;
$this->parameters = array();
if ($currentTag[1]) {
$params = GeneralUtility::get_tag_attributes($currentTag[1]);
if (is_array($params)) {
foreach ($params as $option => $val) {
$this->parameters[strtolower($option)] = $val;
}
}
}
$this->parameters['allParams'] = trim($currentTag[1]);
// Removes NL in the beginning and end of the tag-content AND at the end of the currentTagBuffer.
// $stripNL depends on the configuration of the current tag
if ($stripNL) {
$contentAccum[$contentAccumP - 1] = preg_replace('/' . CR . '?' . LF . '[ ]*$/', '', $contentAccum[$contentAccumP - 1]);
$contentAccum[$contentAccumP] = preg_replace('/^[ ]*' . CR . '?' . LF . '/', '', $contentAccum[$contentAccumP]);
$contentAccum[$contentAccumP] = preg_replace('/' . CR . '?' . LF . '[ ]*$/', '', $contentAccum[$contentAccumP]);
}
$this->data[$this->currentValKey] = $contentAccum[$contentAccumP];
$newInput = $this->cObjGetSingle($theName, $theConf, '/parseFunc/.tags.' . $tag[0]);
// fetch the content object
$contentAccum[$contentAccumP] = $newInput;
$contentAccumP++;
// If the TypoTag section
if (!$breakOut) {
$contentAccum[$contentAccumP - 2] .= $contentAccum[$contentAccumP - 1] . $contentAccum[$contentAccumP];
unset($contentAccum[$contentAccumP]);
unset($contentAccum[$contentAccumP - 1]);
$contentAccumP -= 2;
}
unset($currentTag);
$treated = true;
}
// other tags
if (!$treated) {
$contentAccum[$contentAccumP] .= $data;
}
} else {
// If a tag was not a typo tag, then it is just added to the content
$stripNL = false;
if (GeneralUtility::inList($allowTags, $tag[0]) || $denyTags != '*' && !GeneralUtility::inList($denyTags, $tag[0])) {
$contentAccum[$contentAccumP] .= $data;
} else {
$contentAccum[$contentAccumP] .= HTMLSpecialChars($data);
}
}
$inside = 0;
}
$pointer += $len;
} while ($pointer < $totalLen);
// Parsing nonTypoTag content (all even keys):
reset($contentAccum);
$contentAccumCount = count($contentAccum);
for ($a = 0; $a < $contentAccumCount; $a++) {
if ($a % 2 != 1) {
// stdWrap
if (is_array($conf['nonTypoTagStdWrap.'])) {
$contentAccum[$a] = $this->stdWrap($contentAccum[$a], $conf['nonTypoTagStdWrap.']);
}
// userFunc
if ($conf['nonTypoTagUserFunc']) {
$contentAccum[$a] = $this->callUserFunction($conf['nonTypoTagUserFunc'], $conf['nonTypoTagUserFunc.'], $contentAccum[$a]);
}
}
}
return implode('', $contentAccum);
}
示例6: viewArray
/**
* function just for debugging. It prints an array as a table
* @ingroup debug
*
* @param array_in the array that should be displayed
* @return a html-table that represents the submitted array
*/
function viewArray($array_in)
{
if (is_array($array_in)) {
$result = "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">";
if (!count($array_in)) {
$result .= "<tr><td><font face=\"Verdana, Arial\" size=\"1\"><b>" . HTMLSpecialChars("EMPTY!") . "</b></font></td></tr>";
}
while (list($key, $val) = each($array_in)) {
$result .= "<tr><td><font face=\"Verdana,Arial\" size=\"1\">" . HTMLSpecialChars((string) $key) . "</font></td><td>";
if (is_array($array_in[$key])) {
$result .= $this->viewArray($array_in[$key]);
} else {
$result .= "<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">" . nl2br(HTMLSpecialChars((string) $val)) . "<br /></font>";
}
$result .= "</td></tr>";
}
$result .= "</table>";
} else {
return false;
}
return $result;
}
示例7: PrintOrderBy
<INPUT type="submit" class="12px" value="<?Print $text_show;?>">
</TD></FORM>
</TR><TR>
<?IF($VA_setup['userlog_id']){?><TD align="right" class="b bg_light" nowrap><?Print $text_id; PrintOrderBy("id");?></TD><?}?>
<?IF($VA_setup['userlog_nick']){?><TD class="b bg_light" nowrap><?Print $text_nick; PrintOrderBy("nick");?></TD><?}?>
<?IF($VA_setup['userlog_ip']){?><TD class="b bg_light" nowrap><?Print $text_ip; PrintOrderBy("ip");?></TD><?}?>
<?IF($VA_setup['userlog_date']){?><TD class="b bg_light" nowrap><?Print $text_date; PrintOrderBy("date");?></TD><?}?>
<?IF($VA_setup['userlog_action']){?><TD class="b bg_light" nowrap><?Print $text_action; PrintOrderBy("action");?></TD><?}?>
<?IF($VA_setup['userlog_info']){?><TD class="b bg_light" nowrap><?Print $text_info; PrintOrderBy("info");?></TD><?}?>
</TR>
<?
IF($total > 0) {
$result = $DB_hub->Query($query);
WHILE($row = $result->Fetch_Assoc())
{
$row['nick'] = HTMLSpecialChars($row['nick']);
?>
<TR>
<?IF($VA_setup['userlog_id']){?><TD align="right" class="bg_light"><?Print $row['id'];?></TD><?}?>
<?IF($VA_setup['userlog_nick']){?><TD class="bg_light"><?Print $row['nick'];?></TD><?}?>
<?IF($VA_setup['userlog_ip']){?><TD class="bg_light"><?Print $row['ip'];?></TD><?}?>
<?IF($VA_setup['userlog_date']){?><TD class="bg_light"><?Print Date($VA_setup['timedate_format'], $row['date']);?></TD><?}?>
<?IF($VA_setup['userlog_action']) {?>
<TD class="bg_light">
<?$action = "text_action_".$row['action'];
Print $$action;?>
</TD>
<?}?>
<?IF($VA_setup['userlog_info']) {?>
<TD class="bg_light">
<?$info = "text_info_".$row['info'];
示例8: ceil
$info_num = 3;
$pagenum = ceil($total / $info_num);
if ($page > $pagenum || $page == 0) {
echo "Error : Can Not Found The page .";
exit;
}
$offset = ($page - 1) * $info_num;
$info = mysql_query("select * from member limit {$offset},{$info_num}");
while ($it = mysql_fetch_array($info)) {
echo "账号: " . HTMLSpecialChars($it['member_account']) . "<br>";
//防sql注入
echo "姓名: " . HTMLSpecialChars($it['member_name']) . "<br>";
echo "性别: " . HTMLSpecialChars($it['sex']) . "<br>";
echo "学号: " . HTMLSpecialChars($it['schoolnumber']) . "<br>";
echo "手机号码:" . HTMLSpecialChars($it['phonenumber']) . "<br>";
echo "电子邮箱:" . HTMLSpecialChars($it['email']) . "<hr>";
}
if ($page > 1) {
echo "<a href='member_index.php?page=" . ($page - 1) . "'>前一页</a> ";
} else {
echo "前一页  ";
}
for ($i = 1; $i <= $pagenum; $i++) {
//数字页面
$show = $i != $page ? "<a href='member_index.php?page=" . $i . "'>" . $i . "</a>" : "{$i}";
echo $show . " ";
}
if ($page < $pagenum) {
echo "<a href='member_index.php?page=" . ($page + 1) . "'>后一页</a>";
} else {
echo "后一页";
示例9: HTMLSpecialChars
<p>
<label for="<?php
echo $this->Field_Name('thumb_height');
?>
"><?php
echo $this->t('Thumbnail height:');
?>
</label>
<input type="text" name="<?php
echo $this->Field_Name('thumb_height');
?>
" id="<?php
echo $this->Field_Name('thumb_height');
?>
" value="<?php
echo HTMLSpecialChars($this->Get_Gallery_Meta('thumb_height'));
?>
" size="4" />px
</p>
<p>
<input type="checkbox" name="<?php
echo $this->Field_Name('thumb_grayscale');
?>
" id="<?php
echo $this->Field_Name('thumb_grayscale');
?>
" value="yes" <?php
Checked($this->Get_Gallery_Meta('thumb_grayscale'), 'yes');
?>
/>
示例10: HTMLSpecialChars
<td><label for="excerpt_image_number"><?php
echo $this->t('Images per Excerpt:');
?>
</label></td>
<td><input type="text" name="excerpt_image_number" id="excerpt_image_number" value="<?php
echo HTMLSpecialChars($this->Get_Option('excerpt_image_number'));
?>
" size="4"></td>
</tr>
</tr>
<tr>
<td><label for="excerpt_thumb_width"><?php
echo $this->t('Thumbnail width:');
?>
</label></td>
<td><input type="text" name="excerpt_thumb_width" id="excerpt_thumb_width" value="<?php
echo HTMLSpecialChars($this->Get_Option('excerpt_thumb_width'));
?>
" size="4">px</td>
</tr>
<tr>
<td><label for="excerpt_thumb_height"><?php
echo $this->t('Thumbnail height:');
?>
</label></td>
<td><input type="text" name="excerpt_thumb_height" id="excerpt_thumb_height" value="<?php
echo HTMLSpecialChars($this->Get_Option('excerpt_thumb_height'));
?>
" size="4">px</td>
</tr>
</table>
示例11: foreach
<p><?php
echo $this->t('Please choose a template to display the excerpt of this gallery.');
?>
</p>
<?php
foreach ($this->Get_Template_Files() as $name => $properties) {
?>
<p>
<input type="radio" name="<?php
echo $this->Field_Name('excerpt_template');
?>
" id="excerpt_template_<?php
echo Sanitize_Title($properties['file']);
?>
" value="<?php
echo HTMLSpecialChars($properties['file']);
?>
"
<?php
Checked($this->Get_Gallery_Meta('excerpt_template'), $properties['file']);
?>
<?php
Checked(!$this->Get_Gallery_Meta('excerpt_template') && $properties['file'] == $this->Get_Default_Template());
?>
/>
<label for="excerpt_template_<?php
echo Sanitize_Title($properties['file']);
?>
">
<?php
if (empty($properties['name'])) {
示例12: foreach
<tr>
<td class='text_grey'>
<table width="100%" border="0" cellspacing="6" cellpadding="6">
<?php
foreach ($e_templates as $key => $value) {
?>
<tr>
<td class='text_grey'>
<b><?php
$et = "email_template_" . $value['email_id'];
echo $BL->props->lang[$et];
?>
</b><br />
<pre><?php
$et = "template_default_" . $value['email_id'];
echo HTMLSpecialChars($BL->props->lang[$et]);
?>
</pre>
</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
</div>
</table>
</div>
示例13: SPrintF
// Read base url
$base_url = SPrintF('%s/%s', Get_Bloginfo('wpurl'), SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH)));
$base_url = Str_Replace("\\", '/', $base_url);
// Windows Workaround
?>
<div class="gallery fancy-gallery <?php
echo BaseName(__FILE__, '.php');
?>
" id="gallery_<?php
echo $this->gallery->id;
?>
"><?php
foreach ($this->gallery->images as $image) {
// Build <img> Tags
$img_code = '<img';
foreach ($image->attributes as $attribute => $value) {
$img_code .= SPrintF(' %s="%s"', $attribute, HTMLSpecialChars(Strip_Tags($value)));
}
$img_code .= '>';
// Build FB share button
$fb_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s" target="_blank">%4$s</a>', SPrintF('https://www.facebook.com/sharer/sharer.php?u=%s', $image->href), HTMLSpecialChars($image->title), $this->gallery->attributes->link_class, SPrintF('<img src="%s/facebook-button.png" alt="Share it" height="20">', $base_url));
// Build Pintarest share button
$pinterest_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s" target="_blank">%4$s</a>', SPrintF('https://pinterest.com/pin/create/button/?url=%1$s&media=%2$s', Get_Permalink($this->gallery->id), $image->href), HTMLSpecialChars($image->title), $this->gallery->attributes->link_class, SPrintF('<img src="%s/pinterest-button.png" alt="Pin it" height="20">', $base_url));
// Build Twitter share button
$twitter_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s" target="_blank">%4$s</a>', SPrintF('https://twitter.com/share?url=%1$s', $image->href), HTMLSpecialChars($image->title), $this->gallery->attributes->link_class, SPrintF('<img src="%s/twitter-button.png" alt="Tweet it" height="20">', $base_url));
// Build <a> Tag for the image
$link_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s">%4$s</a>', $image->href, HTMLSpecialChars(SPrintF('%s %s %s %s', $image->title, $fb_code, $pinterest_code, $twitter_code)), $this->gallery->attributes->link_class, $img_code);
echo $link_code;
}
?>
</div>
示例14: IF
<?
IF($_POST['submit_lang']) {
Print "submit_lang provedeno";
$lang = $_POST['mlanguage'];
UnSet($_POST['submit_lang']);
UnSet($_POST['lang']);
WHILE(List($var, $val) = Each($_POST)) {
$val = VA_Escape_String($DB_hub, $val);
$val = HTMLSpecialChars($val);
$DB_hub->Query("REPLACE INTO va_languages (language, var, val) VALUES ('".$lang."', '".$var."', '".Trim($val)."')");
}
}
$result = $DB_hub->Query("SELECT var, val FROM va_languages WHERE language LIKE 'en'");
?>
<FORM action="index.php?q=lang_center" method="post">
<TABLE class="b1 fs10px">
<TR>
<TD class="bg_light right" colspan=3><INPUT class="w75px" name="submit_lang" type="submit" value="<?Print $text_send;?>"></TD>
</TR><TR>
<TD class="b bg_light right"> <?Print $text_language;?> : </TD>
<TD class="bg_light"><INPUT class="w300px" name="mlanguage" type="text" value="<?Print LANG;?>"></TD>
<TD class="bg_light"> </TD>
</TR><TR>
<TD class="b bg_light right"> </TD>
<TD class="b bg_light"> </TD>
<TD class="b bg_light"> </TD>
</TR><TR>
<TD class="b bg_light right"> <?Print $text_var;?> : </TD>
示例15: PrintOrderBy
<?IF($VA_setup['kicklist_ip']){?><TD class="b bg_light" nowrap><?Print $text_ip; PrintOrderBy("ip");?></TD><?}?>
<?IF($VA_setup['kicklist_host']){?><TD class="b bg_light" nowrap><?Print $text_host; PrintOrderBy("host");?></TD><?}?>
<?IF($VA_setup['kicklist_share_size']){?><TD class="b bg_light" nowrap><?Print $text_share_size; PrintOrderBy("share_size");?></TD><?}?>
<?IF($VA_setup['kicklist_email']){?><TD class="b bg_light" nowrap><?Print $text_email; PrintOrderBy("email");?></TD><?}?>
<?IF($VA_setup['kicklist_reason']){?><TD class="b bg_light" nowrap><?Print $text_reason; PrintOrderBy("reason");?></TD><?}?>
<?IF($VA_setup['kicklist_op']){?><TD class="b bg_light" nowrap><?Print $text_op; PrintOrderBy("op");?></TD><?}?>
<?IF($VA_setup['kicklist_is_drop']){?><TD class="b bg_light" nowrap><?Print $text_is_drop; PrintOrderBy("is_drop");?></TD><?}?>
</TR>
<?
IF($total > 0) {
$result = $DB_hub->Query($query);
WHILE($row = $result->Fetch_Assoc())
{
$row['nick'] = HTMLSpecialChars($row['nick']);
$row['op'] = HTMLSpecialChars($row['op']);
$row['reason'] = HTMLSpecialChars($row['reason']);
$info = $text_nick." : ".$row['nick']."<BR>";
$info .= $text_time." : ".Date($VA_setup['timedate_format'], $row['time'])."<BR>";
$info .= $text_ip." : ".$row['ip']."<BR>";
$info .= $text_host." : ".$row['host']."<BR>";
$info .= $text_share_size." : ".Number_Format($row['share_size'])." (".RoundShare($row['share_size']).")<BR>";
$info .= $text_email." : ".$row['email']."<BR>";
$info .= $text_op." : ".$row['op']."<BR>";
IF($row['is_drop'])
$info .= $text_is_drop." : ".$text_yes."<BR>";
ELSE
$info .= $text_is_drop." : ".$text_no."<BR>";
$info .= $text_reason." :<BR>".$row['reason'];
?>
<TR onmouseover="JavaScript: return escape('<?Print AddSlashes($info);?>');">