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


PHP StripSlashes函数代码示例

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


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

示例1: get_cached_config

function get_cached_config($qrystr, $cachetime = 0)
{
    global $dbhost, $dbuser, $dbpass, $database, $num_queries, $cached_querys;
    $cache_file = realpath(dirname(__FILE__) . '/..') . '/cache/' . md5($qrystr) . '.txt';
    $num_queries++;
    if ($cachetime > 0) {
        if (file_exists($cache_file) && time() - $cachetime < filemtime($cache_file)) {
            $cached_querys++;
            return unserialize(file_get_contents($cache_file));
        }
    }
    $GLOBALS["___mysqli_ston"] = mysqli_connect($dbhost, $dbuser, $dbpass) or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
    (bool) mysqli_query($GLOBALS["___mysqli_ston"], "USE {$database}") or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
    $mr = mysqli_query($GLOBALS["___mysqli_ston"], $qrystr . " -- " . $mySecret) or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
    while ($mz = mysqli_fetch_assoc($mr)) {
        if ($mz['value'] == 'true') {
            $return[$mz['key']] = true;
        } elseif ($mz['value'] == 'false') {
            $return[$mz['key']] = false;
        } elseif (is_numeric($mz['value'])) {
            $return[$mz['key']] = max(0, $mz['value']);
        } else {
            $return[$mz['key']] = StripSlashes($mz['value']);
        }
    }
    unset($mz);
    mysqli_free_result($mr) || is_object($mr) && get_class($mr) == "mysqli_result" ? true : false;
    is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"])) ? false : $___mysqli_res;
    if ($cachetime > 0) {
        $fp = fopen($cache_file, 'w');
        fputs($fp, serialize($return));
        fclose($fp);
    }
    return $return;
}
开发者ID:fchypzero,项目名称:cybyd,代码行数:35,代码来源:config.php

示例2: get_cached_config

function get_cached_config($qrystr, $cachetime = 0)
{
    global $dbhost, $dbuser, $dbpass, $database, $num_queries, $cached_querys;
    $cache_file = realpath(dirname(__FILE__) . '/..') . '/cache/' . md5($qrystr) . '.txt';
    $num_queries++;
    if ($cachetime > 0) {
        if (file_exists($cache_file) && time() - $cachetime < filemtime($cache_file)) {
            $cached_querys++;
            return unserialize(file_get_contents($cache_file));
        }
    }
    mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
    mysql_select_db($database) or die(mysql_error());
    $mr = mysql_query($qrystr) or die(mysql_error());
    while ($mz = mysql_fetch_assoc($mr)) {
        if ($mz['value'] == 'true') {
            $return[$mz['key']] = true;
        } elseif ($mz['value'] == 'false') {
            $return[$mz['key']] = false;
        } elseif (is_numeric($mz['value'])) {
            $return[$mz['key']] = max(0, $mz['value']);
        } else {
            $return[$mz['key']] = StripSlashes($mz['value']);
        }
    }
    unset($mz);
    mysql_free_result($mr);
    mysql_close();
    if ($cachetime > 0) {
        $fp = fopen($cache_file, 'w');
        fputs($fp, serialize($return));
        fclose($fp);
    }
    return $return;
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:35,代码来源:config.php

示例3: selectni

function selectni($tablename, $where)
{
    global $database;
    $q = "describe {$tablename}";
    $set = $database->query($q);
    if ($where == "") {
        $q2 = "select * from {$tablename}";
    } else {
        $where = StripSlashes($where);
        $q2 = "select * from {$tablename} where {$where}";
    }
    echo $q2 . "<br>";
    $set2 = $database->query($q2);
    while ($set->next()) {
        $field = $set->getString('Field');
        $fields[] = $field;
        $type = $set->getString('Type');
        $null = $set->getString('Null');
    }
    echo "<table border='1'><tr>";
    for ($i = 0; $i < count($fields); $i++) {
        echo "<td><b>" . $fields[$i] . "</b></td>";
    }
    echo "</tr><tr>";
    while ($set2->next()) {
        for ($i = 0; $i < count($fields); $i++) {
            $onefield = $set2->getString($fields[$i]);
            echo "<td>" . $onefield . "</td>";
        }
        echo "</tr><tr>";
    }
    echo "</tr></table>";
}
开发者ID:Harvie,项目名称:Kyberia,代码行数:33,代码来源:dbselect.php

示例4: ShowFaq

function ShowFaq($id_cat, $categories)
{
    global $sitename, $NPDS_Prefix;
    echo '
   <h2>' . translate("FAQ (Frequently Ask Question)") . '</h2>
   <h3>' . translate("Categories") . '</h3>
   <p class="lead">
      <a href="faq.php" title="' . translate("Back to FAQ Index") . '" data-toggle="tooltip">' . translate("Main") . '</a>&nbsp;&raquo;&raquo;&nbsp;' . StripSlashes($categories) . '
   </p>';
    $result = sql_query("SELECT id, id_cat, question, answer FROM " . $NPDS_Prefix . "faqanswer WHERE id_cat='{$id_cat}'");
    while (list($id, $id_cat, $question, $answer) = sql_fetch_row($result)) {
    }
}
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:13,代码来源:faq.php

示例5: fee_calculation

 /**
  * 函数fee_calculation 配送费用计算.
  *
  * @param $weight 包裹重量
  * @param $info 包裹信息
  * @param $subtotal 费用和
  * @param $fee_info 费用信息
  * @param $fee 费用
  * @param $other_fee 另外的费用
  *
  * @return $fee 包裹费用
  */
 public function fee_calculation($weight, $info, $subtotal)
 {
     $weight *= 1000;
     //kg=>g
     $fee_info = @unserialize(StripSlashes($info['fee_configures']));
     $fee = 0;
     if ($subtotal < $info['free_subtotal'] || $info['free_subtotal'] == 0) {
         if ($weight <= 1000 && isset($fee_info['0']['value'])) {
             return $fee_info['0']['value'];
         } elseif ($weight <= 5000 && isset($fee_info['0']['value']) && isset($fee_info['1']['value'])) {
             $other_fee = ceil(($weight - 1000) / 500) * $fee_info['1']['value'];
             return $fee_info['0']['value'] + $other_fee;
         } elseif (isset($fee_info['0']['value']) && isset($fee_info['2']['value'])) {
             $other_fee = ceil(($weight - 1000) / 500) * $fee_info['2']['value'];
             return $fee_info['0']['value'] + $other_fee;
         }
     }
     return $fee;
 }
开发者ID:hobbysh,项目名称:seevia-opensource,代码行数:31,代码来源:shipping_area.php

示例6: implode

					document.addpersons.role' . $iterator . '.name = "norole[]";
				}
				return true;
			}
			// -->
			</script>';
                echo '<tr class="' . ($even % 2 == 0 ? 'even' : 'odd') . '"><td><input type="checkbox" id="isthere' . $iterator . '" name="person[]" value="' . $rec['id'] . '" class="checkbox"' . ($rec['iduser'] ? ' checked="checked"' : '') . ' onClick="NameChanger' . $iterator . '();"/></td>
	<td><select type="role" id="role' . $iterator . '" ' . ($rec['iduser'] ? ' name="role[]' : 'name="norole[]') . '">
			<option value="0">osoba přítomná</option>' . ($type == 1 ? '
			<option value="4"' . ($rec['role'] == 4 ? ' selected="selected"' : '') . '>velitel zásahu</option>
			<option value="3"' . ($rec['role'] == 3 ? ' selected="selected"' : '') . '>zatčený</option>' : '') . ($type == 2 ? '
			<option value="1"' . ($rec['role'] == 1 ? ' selected="selected"' : '') . '>vyslýchaný</option>
			<option value="2"' . ($rec['role'] == 2 ? ' selected="selected"' : '') . '>vyslýchající</option>' : '') . '
		</select></td>
' . ($sportraits ? '<td><img src="getportrait.php?rid=' . $rec['id'] . '" alt="portrét chybí" /></td>' : '') . ($ssymbols ? '<td><img src="getportrait.php?nrid=' . $rec['symbol'] . '" alt="symbol chybí" /></td>' : '') . '
	<td>' . ($rec['secret'] ? '<span class="secret"><a href="readperson.php?rid=' . $rec['id'] . '">' . implode(', ', array(StripSlashes($rec['surname']), StripSlashes($rec['name']))) . '</a></span>' : '<a href="readperson.php?rid=' . $rec['id'] . '">' . implode(', ', array(StripSlashes($rec['surname']), StripSlashes($rec['name']))) . '</a>') . '</td>
	</tr>';
                $even++;
                $iterator++;
            }
            echo '</tbody>
</table>';
        }
        ?>
<input type="hidden" name="fdead" value="<?php 
        echo $fdead;
        ?>
" />
<input type="hidden" name="farchiv" value="<?php 
        echo $farchiv;
        ?>
开发者ID:amberan,项目名称:dhbistro,代码行数:31,代码来源:addp2ar.php

示例7: get_dor_links

function get_dor_links($ids)
{
    foreach ($ids as $id) {
        $result = mysql_query("SELECT `dor_md5`, `index_urls`, `map_urls`, `full_map_url`, `page_urls` FROM `dors` WHERE `id` = '{$id}';");
        if (!$result) {
            echo " xr_function.php, функция get_dor_links. Ошибка вставки данных в базу " . mysql_error();
            exit;
        }
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $domen = $dor['domens'][0] = $row["dor_md5"];
            $index_url_str = trim(str_replace("\n", '', StripSlashes($row["index_urls"])));
            //получаем $mainkey
            $index_url = explode('&', $index_url_str);
            $index_link = explode('||', $index_url[0]);
            $main_url = $index_link[0];
            $main_key = $index_link[1];
            //
            $map_url_str = trim(str_replace("\n", '', StripSlashes($row["map_urls"])));
            if ($map_url_str == 'none' or $map_url_str == '') {
                $map_url_str = $index_url_str;
            }
            $full_map_url_str = trim(str_replace("\n", '', StripSlashes($row["full_map_url"])));
            if ($full_map_url_str == 'none' or $full_map_url_str == '') {
                $full_map_url_str = "http://{$domen}/{$main_url}||{$main_key}";
            } else {
            }
            $page_url_str = trim(str_replace("\n", '', StripSlashes($row["page_urls"])));
            if ($page_url_str == 'none' or $page_url_str == '') {
                $page_url_str = $index_url_str;
            }
            $dor['index_urls'] = explode('&', $index_url_str);
            $dor['map_urls'] = explode('&', $map_url_str);
            $dor['full_map_urls'][0] = $full_map_url_str;
            $dor['page_urls'] = explode('&', $page_url_str);
            $dor['sitemap_xmls'][0] = "http://{$domen}/sitemap.xml||{$main_key}";
            unset($map_url_str, $index_url_str, $full_map_url_str, $page_url_str);
        }
        mysql_free_result($result);
        $dors[] = $dor;
    }
    return $dors;
}
开发者ID:ivrm,项目名称:mbgdorgen,代码行数:42,代码来源:xr_function.php

示例8: _save

 public function _save($properties = "", $vtype = "")
 {
     if (isset($properties) && is_array($properties)) {
         // isn't this double work, the save function doesn this again
         foreach ($properties as $prop_name => $prop) {
             foreach ($prop as $prop_index => $prop_record) {
                 $record = array();
                 foreach ($prop_record as $prop_field => $prop_value) {
                     switch (gettype($prop_value)) {
                         case "integer":
                         case "boolean":
                         case "double":
                             $value = $prop_value;
                             break;
                         default:
                             $value = $prop_value;
                             if (substr($prop_value, 0, 1) === "'" && substr($prop_value, -1) === "'" && "'" . AddSlashes(StripSlashes(substr($prop_value, 1, -1))) . "'" == $prop_value) {
                                 $value = stripSlashes(substr($prop_value, 1, -1));
                                 // todo add deprecated warning
                             }
                     }
                     $record[$prop_field] = $value;
                 }
                 $properties[$prop_name][$prop_index] = $record;
             }
         }
     }
     if ($this->arIsNewObject && $this->CheckSilent('add', $this->type)) {
         unset($this->data->config);
         $result = $this->save($properties, $vtype);
     } else {
         if (!$this->arIsNewObject && $this->CheckSilent('edit', $this->type)) {
             $this->data->config = current($this->get('.', 'system.get.data.config.phtml'));
             $result = $this->save($properties, $vtype);
         }
     }
     return $result;
 }
开发者ID:poef,项目名称:ariadne,代码行数:38,代码来源:ariadne_object.php

示例9: GetDataURL

 function GetDataURL($file)
 {
     if (strlen($this->GetFileDefinition($file, $definition, 0))) {
         return $this->error;
     }
     if (isset($definition["FILENAME"])) {
         $size = @filesize($definition["FILENAME"]);
         if (!($file = @fopen($definition["FILENAME"], "rb"))) {
             return $this->OutputPHPError("could not open data file " . $definition["FILENAME"], $php_errormsg);
         }
         for ($body = ""; !feof($file);) {
             if (GetType($block = @fread($file, $this->file_buffer_length)) != "string") {
                 $this->OutputPHPError("could not read data file", $php_errormsg);
                 fclose($file);
                 return "";
             }
             $body .= $block;
         }
         fclose($file);
         if (GetType($size) == "integer" && strlen($body) != $size) {
             $this->OutputError("the length of the file that was read does not match the size of the part file " . $definition["FILENAME"] . " due to possible data corruption");
             return "";
         }
         if (function_exists("ini_get") && ini_get("magic_quotes_runtime")) {
             $body = StripSlashes($body);
         }
         $body = chunk_split(base64_encode($body));
     } else {
         if (!isset($definition["DATA"])) {
             $this->OutputError("it was not specified a file or data block");
             return "";
         }
         $body = chunk_split(base64_encode($definition["DATA"]));
     }
     return "data:" . $definition["Content-Type"] . ";base64," . $body;
 }
开发者ID:aydancoskun,项目名称:octobercms,代码行数:36,代码来源:email_message.php

示例10: urlencode

         $wait = 0;
     }
     if (utf8::strlen($data["hash"]) > 0) {
         echo "\t<td align='center' class='lista'>" . ($wait > 0 ? $wait . " h" : "---") . "</td>\n";
     }
     //end waitingtime
 }
 echo "\t<td align='center' class='lista'><a href='download.php?id=" . $data["hash"] . "&amp;f=" . urlencode($data["filename"]) . ".torrent'>" . image_or_link("images/download.gif", "", "torrent") . "</a></td>\n";
 include INCL_PATH . "offset.php";
 echo "\t<td align='center' class='lista'>" . date("d/m/Y H:m:s", $data["added"] - $offset) . "</td>\n";
 echo "\t<td align='center' class='lista'>" . misc::makesize((int) $data["size"]) . "</td>\n";
 //Uploaders nick details
 if ($SHOW_UPLOADER && $data["anonymous"] == "true") {
     echo "\t<td align='center' class='lista'>" . ANONYMOUS . "</td>\n";
 } elseif ($SHOW_UPLOADER && $data["anonymous"] == "false") {
     echo "\t<td align='center' class='lista'><a href='userdetails.php?id=" . (int) $data["upname"] . "'>" . StripSlashes($data['prefixcolor'] . security::html_safe($data["uploader"]) . $data['suffixcolor']) . "</a></td>\n";
 }
 //Uploaders nick details
 if ($data["external"] == "no") {
     echo "\t<td align='center' class='" . linkcolor($data["seeds"]) . "'><a href='peers.php?id=" . $data["hash"] . "' title='" . PEERS_DETAILS . "'>" . (int) $data["seeds"] . "</a></td>\n";
     echo "\t<td align='center' class='" . linkcolor($data["leechers"]) . "'><a href='peers.php?id=" . $data["hash"] . "' title='" . PEERS_DETAILS . "'>" . (int) $data["leechers"] . "</a></td>\n";
     if ($data["finished"] > 0) {
         echo "\t<td align='center' class='lista'><a href='torrent_history.php?id=" . $data["hash"] . "' title='History - " . security::html_safe($data["filename"]) . "'>" . number_format((int) $data["finished"], 0) . "</a></td>";
     } else {
         echo "\t<td align='center' class='lista'>---</td>";
     }
 } else {
     // linkcolor
     echo "\t<td align='center' class='" . linkcolor($data["seeds"]) . "'>" . (int) $data["seeds"] . "</td>";
     echo "\t<td align='center' class='" . linkcolor($data["leechers"]) . "'>" . (int) $data["leechers"] . "</td>";
     if ($data["finished"] > 0) {
开发者ID:HDVinnie,项目名称:BtiTracker-1.5.0,代码行数:31,代码来源:torrents.php

示例11: get_group_operations

        $xtpl->parse("main.update.group_tickets.group_ticket_info1");
    }
    $xtpl->parse("main.update.group_tickets");
    get_group_operations($xtpl, "main.update", "form1", 0, 0);
    $type_message = array("comment"=>"Add comments", "reply"=>"Send answer");
    $xtpl->assign("TYPE_MESSAGE", get_drop_down_list($type_message, "message_status"));
    $xtpl->assign("MESSAGE_STATUS", $_REQUEST["message_status"]);
   
    if($template > 0) $xtpl->assign("MESSAGE", get_template($template, 0, 0));

}

$query = "SELECT id, name FROM " . T_TEMPLATES . " 
				WHERE template_website='" . $_SESSION['website_url'] . "'";
$rows = SQL_select($query);

$templates_list = array();
if($rows) foreach($rows as $val) $templates_list[$val["id"]] = StripSlashes(htmlspecialchars($val["name"]));
$xtpl->assign("TEMPLATES_LIST", get_drop_down_list($templates_list, "template", "", "Select template", 0, "", " onchange=\"document.getElementById('form2').submit();\""));
get_queues_status($xtpl);
$sign_text=showsignature();
$sign_text2="\n\n\n\n\n".$sign_text;
 if ($template==0)
    $xtpl->assign("MESSAGE",$sign_text2);
 

$xtpl->parse("main.update");
$xtpl->parse("main");
$xtpl->out("main");
?>
开发者ID:railroadman2k,项目名称:ccss,代码行数:30,代码来源:update.php

示例12: recursive_strip

function recursive_strip($a)
{
    if (is_array($a)) {
        while (list($key, $val) = each($a)) {
            $a[$key] = recursive_strip($val);
        }
    } else {
        $a = StripSlashes($a);
    }
    return $a;
}
开发者ID:henare,项目名称:electionleaflets,代码行数:11,代码来源:functions.php

示例13: HtmlSpecialChars

?>
<HTML>
<HEAD>
  <TITLE>mnoGoSearch: <? echo HtmlSpecialChars(StripSlashes($query_orig)); ?></TITLE>
</HEAD>

<body BGCOLOR="#FFFFFF" LINK="#0050A0" VLINK="#0050A0" ALINK="#0050A0">
<center>

  <FORM METHOD=GET ACTION="<? echo $self; ?>">
    <table bgcolor=#eeeee0 border=0 width=100%>
      <tr><td>
          <BR>
          <INPUT TYPE="hidden" NAME="ps" VALUE="10">
          Search for: <INPUT TYPE="text" NAME="q" SIZE=50 VALUE="<? echo HtmlSpecialChars(StripSlashes($query_orig)); ?>">
          <INPUT TYPE="submit" VALUE="Search!"><BR>

          Results per page:
          <SELECT NAME="ps">
            <OPTION VALUE="10" <? if ($ps==10) echo 'SELECTED';?>>10
            <OPTION VALUE="20" <? if ($ps==20) echo 'SELECTED';?>>20
            <OPTION VALUE="50" <? if ($ps==50) echo 'SELECTED';?>>50
          </SELECT>

          Match:
          <SELECT NAME="m">
            <OPTION VALUE="all" <? if ($m=='all') echo 'SELECTED';?>>All
            <OPTION VALUE="any" <? if ($m=='any') echo 'SELECTED';?>>Any
            <OPTION VALUE="bool" <? if ($m=='bool') echo 'SELECTED';?>>Boolean
          </SELECT>
开发者ID:ntemple,项目名称:Mnogosearch-PHP-Search-Class,代码行数:30,代码来源:search.php

示例14: StripSlashes

			  </div>';
            } else {
                echo '<input type="hidden" name="nowner" value="' . $rec['iduser'] . '" />';
            }
            if ($usrinfo['right_org'] == 1) {
                echo '					
				<div>
				<label for="nnotnew">Není nové</label>
					<input type="checkbox" name="nnotnew"/><br/>
				</div>';
            }
            ?>
	<div>
		<label for="notebody">Tělo poznámky:</label>
		<textarea cols="80" rows="7" name="note" id="notebody"><?php 
            echo StripSlashes($rec['note']);
            ?>
</textarea>
	</div>
	<div>
		<input type="hidden" name="noteid" value="<?php 
            echo $_REQUEST['rid'];
            ?>
" />
		<input type="hidden" name="backurl" value="<?php 
            echo 'editnote.php?rid=' . $_REQUEST['rid'];
            ?>
" />
		<input type="hidden" name="idtable" value="<?php 
            echo $_REQUEST['idtable'];
            ?>
开发者ID:amberan,项目名称:dhbistro,代码行数:31,代码来源:editnote.php

示例15: switch

if (!function_exists("Mysql_Connexion")) {
    include "mainfile.php";
}
switch ($apli) {
    case "f-manager":
        $fma = rawurldecode(decrypt($att_id));
        $fma = explode("#fma#", $fma);
        $att_id = decrypt($fma[0]);
        $att_name = decrypt($fma[1]);
    case "forum_npds":
        $userX = base64_decode($user);
        $userdata = explode(":", $userX);
        $marqueurM = substr($userdata[2], 8, 6);
    case "minisite":
    case "getfile":
        $att_name = StripSlashes(str_replace("\"", "", rawurldecode($att_name)));
        if ((preg_match('#^[a-z0-9_\\.-]#i', $att_name) or $Mmod == $marqueurM) and !stristr($att_name, ".*://") and !stristr($att_name, "..") and !stristr($att_name, "../") and !stristr($att_name, "script") and !stristr($att_name, "cookie") and !stristr($att_name, "iframe") and !stristr($att_name, "applet") and !stristr($att_name, "object")) {
            if (preg_match('#^[a-z0-9_/\\.-]#i', $att_id) and !stristr($att_id, ".*://") and !stristr($att_id, "..") and !stristr($att_id, "../") and !stristr($att_id, "script") and !stristr($att_id, "cookie") and !stristr($att_id, "iframe") and !stristr($att_id, "applet") and !stristr($att_id, "object")) {
                $fic = "";
                switch ($apli) {
                    // Forum
                    case "forum_npds":
                        $fic = "modules/upload/upload_forum/{$att_id}.{$apli}.{$att_name}";
                        break;
                        // MiniSite
                    // MiniSite
                    case "minisite":
                        $fic = "users_private/{$att_id}/mns/{$att_name}";
                        break;
                        // Application générique : la présence de getfile.conf.php est nécessaire
                    // Application générique : la présence de getfile.conf.php est nécessaire
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:31,代码来源:getfile.php


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