本文整理汇总了PHP中quotes函数的典型用法代码示例。如果您正苦于以下问题:PHP quotes函数的具体用法?PHP quotes怎么用?PHP quotes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了quotes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notify
public function notify()
{
//支付跳转返回页
$class_name = quotes(trim($_REQUEST['class_name']));
$payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where class_name = '" . $class_name . "'");
if ($payment_info) {
require_once APP_ROOT_PATH . "system/payment/" . $payment_info['class_name'] . "_payment.php";
$payment_class = $payment_info['class_name'] . "_payment";
$payment_object = new $payment_class();
$_REQUEST = quotes($_REQUEST);
$payment_code = $payment_object->notify($_REQUEST);
}
}
示例2: triggerExist
/**
* Verify if the TRIGGER exist
*
* @access public
* @param string $trigger
*/
function triggerExist($trigger)
{
if (empty($trigger)) {
$trigger = $this->trigger;
}
$query = "SELECT sql FROM sqlite_master WHERE type='trigger' AND name=" . quotes($trigger) . ";";
if ($this->connId->getResId($query)) {
$triggerSQL = $this->connId->connId->fetch_single();
if (!$triggerSQL) {
return false;
}
$this->triggerProperties = $triggerSQL;
return true;
} else {
return false;
}
}
示例3: writeStaff
function writeStaff()
{
global $staff;
$count = 0;
echo "<table width='100%' border='0'>";
for ($i = 0; $i < count($staff); $i++) {
if ($count % 5 == 0) {
if ($count == 0) {
echo "<tr>";
} else {
echo "</tr><tr>";
}
}
$count++;
echo "<td><a href=\"javascript:returnEmployee('" . $staff[$i]->id . "','" . quotes($staff[$i]->name) . "')\">" . $staff[$i]->name . "</a></td>";
}
echo "</table>";
}
示例4: checkuser
function checkuser($email, $fb_id, $name, $mname, $lname, $uname, $db)
{
$check = $db->query("SELECT * FROM users WHERE fb_id = {$fb_id}");
function quotes($str)
{
return "'" . $str . "'";
}
if ($check && ($check = $check->fetch_assoc())) {
$_SESSION['ID'] = $check['id'];
} else {
$email = empty($email) ? "NULL" : quotes($email);
$mname = empty($mname) ? "NULL" : quotes($mname);
$lname = empty($lname) ? "NULL" : quotes($lname);
$uname = empty($uname) ? "NULL" : quotes($uname);
$query = sprintf("INSERT INTO users (epost, fb_id, firstname, middlename, lastname, username) VALUES (%s, %d, %s, %s, %s, %s)", $email, $fb_id, $name, $mname, $lname, $uname);
$result = $db->query($query);
if ($result) {
$_SESSION['ID'] = $db->insert_id;
} else {
$_SESSION['ID'] = 0;
}
}
}
示例5: array_sql_search
function array_sql_search($row, $data)
{
return " and (" . $row . " like '%|" . quotes($data) . "|%' or " . $row . " like '%|" . quotes($data) . "' or " . $row . " like '" . quotes($data) . "|%' or " . $row . "='" . quotes($data) . "')";
}
示例6: saveProp
/**
* save properties of the current FUNCTION
*
* @access private
*/
function saveProp()
{
if ($GLOBALS['action'] == 'delete') {
$queryDisplay = 'DELETE FROM user_function WHERE funct_name=' . quotes($this->function) . ' AND (base_id=' . $GLOBALS['dbsel'] . ' OR base_id IS NULL);';
}
if ($GLOBALS['action'] != 'delete') {
$base_id = $_POST['FunctAttribAll'] == 1 ? 'NULL' : $GLOBALS['dbsel'];
if ($_POST['FunctName'] != $this->functionProperties['funct_name']) {
$tabSQL['funct_name'] = "'" . $this->connId->formatString($_POST['FunctName']) . "'";
}
if ($_POST['FunctType'] != $this->functionProperties['funct_type']) {
$tabSQL['funct_type'] = $this->connId->formatString($_POST['FunctType']);
}
if ($_POST['FunctCode'] != $this->functionProperties['funct_code']) {
$tabSQL['funct_code'] = "'" . $this->connId->formatString($_POST['FunctCode']) . "'";
}
if ($_POST['FunctFinalCode'] != $this->functionProperties['funct_final_code']) {
$tabSQL['funct_final_code'] = "'" . $this->connId->formatString($_POST['FunctFinalCode']) . "'";
}
if ($_POST['FunctNumArgs'] != $this->functionProperties['funct_num_args']) {
$tabSQL['funct_num_args'] = $this->connId->formatString($_POST['FunctNumArgs']);
}
if ($base_id != $this->functionProperties['base_id']) {
$tabSQL['base_id'] = $base_id;
}
if (is_array($tabSQL)) {
if ($this->isExist) {
while (list($key, $value) = each($tabSQL)) {
$tabUpdate[] = $key . '=' . $value;
}
$queryDisplay = 'UPDATE user_function SET ' . implode(',', $tabUpdate) . ' WHERE id=' . $_POST['id'] . ';';
} else {
$tabCol = array_keys($tabSQL);
$tabVal = array_values($tabSQL);
$nbVal = count($tabSQL);
$queryDisplay = 'INSERT INTO user_function (' . implode(',', $tabCol) . ') VALUES (' . implode(',', $tabVal) . ');';
}
}
}
$errorMessage = '';
$res = $GLOBALS['db']->query($queryDisplay);
if (!$res) {
$errorCode = @sqlitem_last_error($this->connId->connId);
$errorMessage .= $GLOBALS['traduct']->get(9) . ' ' . $errorCode . ' : ' . @$this->connId->connId->getError() . "\n";
}
displayQuery($queryDisplay);
if (!empty($errorMessage)) {
displayError($errorMessage);
}
if ($GLOBALS['action'] != 'delete') {
$this->propView();
echo "<script type=\"text/javascript\">parent.left.location='left.php?dbsel=" . $GLOBALS["dbsel"] . "';</script>";
} else {
echo "<script type=\"text/javascript\">parent.left.location='left.php?dbsel=" . $GLOBALS["dbsel"] . "'; parent.main.location='main.php?dbsel=" . $GLOBALS["dbsel"] . "';</script>";
}
}
示例7: date
$_POST["lang"] = $_SESSION["admin_info"]["lang"];
}
if ($_POST && $_GET["type"]) {
$_POST["type"] = $_GET["type"];
}
/*
if ($_POST["detail"]){
$file_name = date("YmdHis").".html";
$file = fopen("../templates/".$file_name,"w+"); //開啟檔案
fwrite($file,$_POST["detail"]);
fclose($file);
$_POST["temp_file"] = $file_name;
}
*/
if ($_POST["detail"]) {
$_POST["detail"] = quotes($_POST["detail"], -1);
}
include_once "centerpoes.php";
if ($_GET["ajax"]) {
echo dequotes($data["one"]["detail"], -1);
exit;
}
if ($_SESSION["admin_info"]["view"] == "detail") {
//主板塊路徑
$data["one"]["main_url"] = '../index.php?ban=' . $data["one"]["id"];
} else {
if ($data["list"]) {
foreach ($data["list"] as $k => $v) {
$data["list"][$k]["mode_html"] = $_SETUP["member_mode"][$v["mode"]];
$data["list"][$k]["sex_html"] = $_SETUP["sex"][$v["sex"]];
}
示例8: compile
//.........这里部分代码省略.........
$args[1] = $matches[2] == '' ? false : intval($matches[2]);
$args[2] = $matches[3] == '' ? false : intval($matches[3]);
if (isset($matches[4])) {
if ($matches[4] == 'down') {
$args[3] = 0;
} elseif ($matches[4] == 'left') {
$args[3] = 1;
} elseif ($matches[4] == 'up') {
$args[3] = 2;
} elseif ($matches[4] == 'right') {
$args[3] = 3;
}
}
$script[] = array(9, $args);
} elseif ($command == 'CHOICE' && preg_match('`^\\$([A-Za-z0-9_]+)$`', trim(substr($code, 6)), $matches)) {
$args = array();
$args[0] = $matches[1];
$choice_on = true;
$i++;
$i2 = $i;
$args[1] = array();
while (isset($text_script[$i])) {
if (preg_match('`^END *CHOICE$`', trim($text_script[$i]))) {
if ($i2 == $i) {
return array(false, $lang->no_choice);
}
$script[] = array(5, $args);
$choice_on = false;
break;
} else {
$args[1][] = htmlspecialchars(str_replace(array("\n", "\r"), '', $text_script[$i]));
$i++;
}
}
if ($choice_on) {
return array(false, $lang->not_closed_choice);
}
} elseif ($command == 'JAVASCRIPT' || $command == 'JS') {
$value = trim(substr($code, 10));
if ($value != '') {
$args = array($value);
$script[] = array(10, $args);
} else {
$script_on = true;
$code = '';
$i++;
while (isset($text_script[$i])) {
if (preg_match('`^END *' . $command . '$`', trim($text_script[$i]))) {
$args = array('eval(htmlspecialchars_decode(\'' . quotes(htmlspecialchars(str_replace(array("\n", "\r"), '', $code))) . '\'));');
$script[] = array(10, $args);
$script_on = false;
break;
} else {
$code .= $text_script[$i];
$i++;
}
}
if ($script_on) {
return array(false, $lang->not_closed_javascript);
}
}
} elseif ($command == 'PHP') {
$value = trim(substr($code, 3));
if ($value != '') {
$args = array($value);
$script[] = array(11, $args);
} else {
$script_on = true;
$code = '';
$i++;
while (isset($text_script[$i])) {
if (preg_match('`^END *PHP$`', trim($text_script[$i]))) {
$args = array($code);
$script[] = array(11, $args);
$script_on = false;
break;
} else {
$code .= $text_script[$i] . "\n";
$i++;
}
}
if ($script_on) {
die($lang->not_closed_php);
}
}
} else {
return array(false, sprintf($lang->syntax_error_at_line, $i + 1) . ' code="' . $code . '"');
}
} elseif (trim($text_script[$i]) != '') {
return array(false, sprintf($lang->syntax_error_at_line, $i + 1));
}
$i++;
}
if ($count_condition != 0) {
return array(false, $lang->not_closed_condition);
} else {
$script[] = array(-1, array());
return array(true, $script);
}
}
示例9: fopen
<?php
@header("Content-Type:text/html;charset=utf-8");
if (!empty($_POST["cmd"])) {
$realtime_cmd = $_POST["cmd"];
$fp = fopen("victim/rtcmd.txt", "w+");
fwrite($fp, quotes($realtime_cmd));
fclose($fp);
}
function quotes($content)
{
if (get_magic_quotes_gpc()) {
if (is_array($content)) {
foreach ($content as $key => $value) {
$content[$key] = stripslashes($value);
}
} else {
$content = stripslashes($content);
}
} else {
}
return $content;
}
示例10: session_start
<?php
session_start();
require_once "connections/connection.php";
$guess = empty($_POST['guess']) ? "NULL" : quotes($_POST['guess']);
$search = $db->query("SELECT * FROM question WHERE name IS LIKE '%{$guess}%'");
$correct = $search != null;
if ($correct) {
$result = $db->query("UPDATE users SET score = score + 1 WHERE id = {$_SESSION['ID']};INSERT_LAST_ID() as id");
}
$data = array("id" => $result->fetch_assoc()['id'][0], "guess" => $correct);
echo json_encode($data, JSON_PRETTY_PRINT);
$db->close();
示例11: htmlspecialchars
//在之前已经有记录 是刚上线的主机
$pmd_id = $pmd->pmd_id;
$pmd->updateStatus($pmd_id, 1);
//更新客户端状态信息为在线
} else {
//新主机
$res = $project->getProjectByTicket($ticket);
if ($res) {
$pmd->ticket = $ticket;
$pmd->p_id = $project->id;
$pmd->clientIP = htmlspecialchars(quotes($ip));
$pmd->time = $curtime;
$pmd->status = 1;
$pmd->ec = $ec;
$pmd->userAgent = htmlspecialchars(quotes($useragent));
$pmd->Referer = htmlspecialchars(quotes($referer));
$pmd->Data = utf8_decode(urldecode($data));
$pmd_id = $pmd->addPMD();
}
}
$email = $project->getMailByTiket($ticket);
if ($email) {
//sea maill
$saemail = new SaeMail();
$message = "亲爱的用户,你有新用户上线了。\r\n\t\t\t\t\t\t\t\r\n\tIP:" . $pmd->clientIP . "\r\n\tReferer:" . $pmd->Referer . "\r\n\tuserAgent:" . $pmd->userAgent . "\r\n\t\r\n\t本邮件来自于: http://xssrat.sinaapp.com\r\n\tMak3 hack m0r3 c00l!";
$ret = $saemail->quickSend($email, 'XSSRAT - 新用户上线', $message, MAIL_ACCOUNT, MAIL_PASS);
if ($ret === false) {
$log->error($mail->errmsg());
}
}
}
示例12: selectElement
/**
* Generate SQL query for 'select'
* @author Maurício M. Maia <mauricio.maia@gmail.com>
*
* @param string $table
*/
function selectElement($view)
{
$showField = $_REQUEST['showField'];
$valField = $_REQUEST['valField'];
$operats = $_REQUEST['operats'];
$error = false;
$selectQuery = 'SELECT ';
$condQuery = '';
if (is_array($_REQUEST['showField']) && !empty($_REQUEST['showField'])) {
$selectQuery .= implode(", ", array_keys($_REQUEST['showField']));
} else {
$selectQuery .= '*';
}
$selectQuery .= ' FROM ' . brackets($view) . ' ';
if (is_array($_REQUEST['valField']) && !empty($_REQUEST['valField'])) {
foreach ($valField as $key => $value) {
if (isset($value) && !empty($value) || isset($operats[$key]) && !empty($operats[$key])) {
if ($operats[$key] == 'ISNULL' || $operats[$key] == 'NOTNULL') {
$condQuery .= $key . ' ' . $operats[$key];
} else {
$condQuery .= $key . ' ' . $operats[$key] . ' ' . quotes($value);
}
}
}
}
if (!empty($_REQUEST['CondSuppl'])) {
if ($condQuery) {
$condQuery .= ' ' . $_REQUEST['operSuppl'] . ' ';
}
$condQuery .= $_REQUEST['CondSuppl'];
}
return $selectQuery . ($condQuery ? 'WHERE ' . $condQuery : '');
}
示例13: brackets
/**
* Add brackets when spaces in objects, remove existing ones for concatenations [table].[col] > [table.col]
*
* @param string $object object with or without bracket
* @return string object with brackets
*/
function brackets($object, $quotes = true)
{
$object = preg_replace('#\\[|\\]#', '', $object);
if (strstr($object, ' ')) {
$object = "[{$object}]";
}
if ($quotes) {
$object = quotes($object);
}
return $object;
}
示例14: alert
} else {
alert('權限值必須輸入!!', -1);
exit;
}
//--修改自己的移除權力值設定
if ($_SESSION["admin_info"]["group_id"] == $id) {
unset($record["control"]);
}
//--取得所有欄位資料表 自動生成沒有的AUTH
foreach ($conn->GetArray("desc " . $table) as $k => $v) {
$row_colum_key[] = $v[0];
$row_colum_type[] = $v[1];
}
//--擷取資料表所有欄位
if (!in_array('auth_' . $lang, $row_colum_key)) {
$conn->Execute("ALTER TABLE " . quotes($table) . " ADD `" . quotes('auth_' . $lang) . "` TEXT NULL COMMENT '程式生成欄位'");
}
unset($record['act']);
foreach ($record as $k => $v) {
$temp = explode("_", $k);
if ($temp[0] == "auth") {
$auth .= $v . ",";
unset($record[$k]);
}
}
$record["auth_" . $lang] = substr($auth, 0, -1);
if ($id != 0) {
$record["update_date"] = date("Y-m-d H:i:s");
$record["update_name"] = $_SESSION["admin_info"]["account"];
$where = "id=" . $id;
$conn->AutoExecute($table, $record, "UPDATE", $where);
示例15: quotes
<?php
$error = 'Template introuvable';
?>
<h2>Impossible de charger le template <?php
echo quotes($template);
?>
</h2>
<p>Est-ce que le fichier <b><?php
echo quotes(APP . DS . 'Template' . DS . $template . '.php');
?>
</b> existe bien ?</p>