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


PHP AddSlashes函数代码示例

本文整理汇总了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();
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:31,代码来源:lib_flickr_faves.php

示例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&amp;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&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=invitations&amp;action=delete&amp;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);
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:30,代码来源:admin.invitations.php

示例3: DecryptAll_SQL

function DecryptAll_SQL($s, $key)
{
    $s = DecryptROT($s);
    $s = SaXoro($s, $key);
    $s = Decrypt($s);
    return AddSlashes(trim(str_replace("^(**)^", "&", $s)));
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:7,代码来源:crypto.php

示例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;
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:8,代码来源:lib_flickr_contacts.php

示例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;
 }
开发者ID:lursu,项目名称:morgue,代码行数:8,代码来源:lib.php

示例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;
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:8,代码来源:lib_flickr_geobookmarks.php

示例7: fixQuotes

function fixQuotes($inp)
{
    if (get_magic_quotes_gpc()) {
        return $inp;
    } else {
        return AddSlashes($inp);
    }
}
开发者ID:BackupTheBerlios,项目名称:ridedammit-svn,代码行数:8,代码来源:RDdbclasses.php

示例8: SqlString

function SqlString(&$value){
//我写的,好简陋,直接调用特殊字符加反斜杠的函数(只作用于单引号,双引号,反斜线)
	if(is_array($value)){
		array_walk($value,'SqlString');
	}else{
		$value=AddSlashes($value);
		//echo $value;
	}
}
开发者ID:houkunlin,项目名称:yiban,代码行数:9,代码来源:mysql_config.php

示例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();
 }
开发者ID:poef,项目名称:ariadne,代码行数:9,代码来源:dialog.import.save.php

示例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;
}
开发者ID:whosonfirst,项目名称:flamework-api,代码行数:10,代码来源:lib_api_oauth2_grant_tokens.php

示例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;
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:10,代码来源:search.php

示例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);
    }
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:10,代码来源:lib_flickr_push_photos.php

示例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;
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:11,代码来源:lib_dots_search_extras.php

示例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);
	}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:11,代码来源:photo_gallery.php

示例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);
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:12,代码来源:lib_dots_lookup.php


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