本文整理汇总了PHP中AddSlashes函数的典型用法代码示例。如果您正苦于以下问题:PHP AddSlashes函数的具体用法?PHP AddSlashes怎么用?PHP AddSlashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddSlashes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flickr_faves_add_fave
function flickr_faves_add_fave(&$viewer, &$photo, $date_faved = 0)
{
if (!$date_faved) {
$date_faved = time();
}
$cluster_id = $viewer['cluster_id'];
$fave = array('user_id' => $viewer['id'], 'photo_id' => $photo['id'], 'owner_id' => $photo['user_id'], 'date_faved' => $date_faved);
$insert = array();
foreach ($fave as $k => $v) {
$insert[$k] = AddSlashes($v);
}
$rsp = db_insert_users($cluster_id, 'FlickrFaves', $insert);
if (!$rsp['ok'] && $rsp['error_code'] != 1062) {
return $rsp;
}
# now update the photo owner side of things
$owner = users_get_by_id($photo['user_id']);
$cluster_id = $owner['cluster_id'];
$fave = array('user_id' => $owner['id'], 'photo_id' => $photo['id'], 'viewer_id' => $viewer['id']);
$insert = array();
foreach ($fave as $k => $v) {
$insert[$k] = AddSlashes($v);
}
$rsp = db_insert_users($cluster_id, 'FlickrFavesUsers', $insert);
if (!$rsp['ok'] && $rsp['error_code'] != 1062) {
return $rsp;
}
# TO DO: index/update the photo in solr and insert $viewer['id']
# into the faved_by column (20111123/straup)
return okay();
}
示例2: read_invitations
function read_invitations()
{
global $TABLE_PREFIX, $admintpl, $language, $CURUSER, $STYLEPATH, $btit_settings;
$scriptname = htmlspecialchars($_SERVER["PHP_SELF"] . "?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=invitations");
$addparam = "";
$res = get_result("SELECT COUNT(*) as invites FROM {$TABLE_PREFIX}invitations", true);
$count = $res[0]["invites"];
list($pagertop, $pagerbottom, $limit) = pager('15', $count, $scriptname . "&");
$admintpl->set("inv_pagertop", $pagertop);
$admintpl->set("inv_pagerbottom", $pagerbottom);
$results = get_result("SELECT * FROM {$TABLE_PREFIX}invitations ORDER BY id DESC {$limit}", true);
$invitees = array();
$i = 0;
foreach ($results as $id => $data) {
$res = do_sqlquery("SELECT username FROM {$TABLE_PREFIX}users WHERE id = " . $data["inviter"], true);
if (mysql_num_rows($res) > 0) {
$inviter_name = mysql_result($res, 0, 0);
} else {
$inviter_name = 'Unknown';
}
$invitees[$i]["inviter"] = "<a href=\"index.php?page=userdetails&user=" . $data["inviter"] . "\">" . $inviter_name . "</a>";
$invitees[$i]["invitee"] = unesc($data["invitee"]);
$invitees[$i]["hash"] = unesc($data["hash"]);
$invitees[$i]["time_invited"] = $data["time_invited"];
$invitees[$i]["delete"] = "<a href=\"index.php?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=invitations&action=delete&id=" . $data["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
$i++;
}
$admintpl->set("invitees", $invitees);
$admintpl->set("language", $language);
}
示例3: DecryptAll_SQL
function DecryptAll_SQL($s, $key)
{
$s = DecryptROT($s);
$s = SaXoro($s, $key);
$s = Decrypt($s);
return AddSlashes(trim(str_replace("^(**)^", "&", $s)));
}
示例4: flickr_contacts_purge_contacts
function flickr_contacts_purge_contacts(&$user)
{
$cluster_id = $user['cluster_id'];
$enc_id = AddSlashes($user['id']);
$sql = "DELETE FROM FlickrContacts WHERE user_id='{$enc_id}'";
$rsp = db_write_users($cluster_id, $sql);
return $rsp;
}
示例5: db_escape_terms
private static function db_escape_terms($terms)
{
$out = array();
foreach ($terms as $term) {
$out[] = '[[:<:]]' . AddSlashes(Search::escape_rlike($term)) . '[[:>:]]';
}
return $out;
}
示例6: flickr_geobookmarks_purge_for_user
function flickr_geobookmarks_purge_for_user(&$user)
{
$cluster_id = $user['cluster_id'];
$enc_id = AddSlashes($user['id']);
$sql = "DELETE FROM FlickrGeoBookmarks WHERE user_id='{$enc_id}'";
$rsp = db_write_users($cluster_id, $sql);
return $rsp;
}
示例7: fixQuotes
function fixQuotes($inp)
{
if (get_magic_quotes_gpc()) {
return $inp;
} else {
return AddSlashes($inp);
}
}
示例8: SqlString
function SqlString(&$value){
//我写的,好简陋,直接调用特殊字符加反斜杠的函数(只作用于单引号,双引号,反斜线)
if(is_array($value)){
array_walk($value,'SqlString');
}else{
$value=AddSlashes($value);
//echo $value;
}
}
示例9: display
function display($str)
{
echo "<script type='text/javascript'>\n";
echo "var line = document.createElement('SPAN');";
echo "line.innerHTML = '" . str_replace("\n", "<br>", AddSlashes(htmlspecialchars($str))) . "';\n";
echo "document.getElementById('progress_verbose').appendChild(line);\n";
echo "</script>";
flush();
}
示例10: api_oauth2_grant_tokens_delete
function api_oauth2_grant_tokens_delete(&$token)
{
$enc_code = AddSlashes($token['code']);
$sql = "DELETE FROM OAuth2GrantTokens WHERE code='{$enc_code}'";
$rsp = db_write($sql);
if ($rsp['ok']) {
api_oauth2_grant_tokens_purge_cache($token);
}
return $rsp;
}
示例11: search_db_escape_terms
function search_db_escape_terms($terms){
$out = array();
foreach($terms as $term){
$out[] = '[[:<:]]'.AddSlashes(hwd_vs_search::search_escape_rlike($term)).'[[:>:]]';
// 20110119 dhorsfall
// optional partial word search
// $out[] = AddSlashes(hwd_vs_search::search_escape_rlike($term));
}
return $out;
}
示例12: flickr_push_photos_purge
function flickr_push_photos_purge()
{
$now = time();
$then = $now - 60 * 60 * 24;
$enc_then = AddSlashes($then);
$sql = "DELETE FROM FlickrPushPhotos WHERE created < {$enc_then}";
foreach ($GLOBALS['cfg']['db_users']['host'] as $cluster_id => $ignore) {
db_write_users($cluster_id, $sql);
}
}
示例13: dots_search_extras_remove_dot
function dots_search_extras_remove_dot(&$dot)
{
$enc_id = AddSlashes($dot['id']);
$sql = "DELETE FROM DotsSearchExtras WHERE dot_id='{$enc_id}'";
$rsp = db_write($sql);
if ($rsp['ok']) {
$cache_key = "dots_search_extras_{$dot['id']}";
cache_unset($cache_key);
}
return $rsp;
}
示例14: BuildUrl
public function BuildUrl($page) {
// Método encargado de armar la url asociada a los links de las páginas..
$_REQUEST["pagina"] = $page;
$result = $_SERVER["PHP_SELF"]."?";
foreach ($_REQUEST as $key => $value)
$result.= $key."=".$value."&";
return AddSlashes($result);
}
示例15: dots_lookup_add_lots_of_dots
function dots_lookup_add_lots_of_dots(&$dots, $add_offline = 0)
{
$_dots = array();
foreach ($dots as $d) {
$hash = array();
foreach ($d as $key => $value) {
$hash[$key] = AddSlashes($value);
}
$_dots[] = $hash;
}
return db_insert_many('DotsLookup', $_dots);
}