本文整理汇总了PHP中sqlReplace函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlReplace函数的具体用法?PHP sqlReplace怎么用?PHP sqlReplace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlReplace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
/**
* getstatus.php 动态获取订单状态
*/
header("Content-type: text/html; charset=utf-8");
include "include/dbconn.php";
//require_once("usercheck.php");
$orderid = sqlReplace(trim($_GET['id']));
$orderkey = sqlReplace(trim($_GET['key']));
$url = empty($_GET['url']) ? '' : sqlReplace(trim($_GET['url']));
$sql = "select * from " . WIIDBPRE . "_order where order_id=" . $orderid;
$rs = mysql_query($sql);
$row = mysql_fetch_assoc($rs);
//检查是否可以催餐
$isHurry_30 = false;
$isHurry_45 = false;
$isHurry_60 = false;
$sql = "select * from " . WIIDBPRE . "_orderchange where orderchange_type='1' and orderchange_hurry='0' and orderchange_order='" . $row['order_id2'] . "'";
$rs = mysql_query($sql);
$rows = mysql_fetch_assoc($rs);
if ($rows) {
$isHurry_30 = true;
}
$sql = "select * from " . WIIDBPRE . "_orderchange where orderchange_type='1' and orderchange_hurry='1' and orderchange_order='" . $row['order_id2'] . "'";
$rs = mysql_query($sql);
$rows = mysql_fetch_assoc($rs);
if ($rows) {
$isHurry_45 = true;
}
$sql = "select * from " . WIIDBPRE . "_orderchange where orderchange_type='1' and orderchange_hurry='2' and orderchange_order='" . $row['order_id2'] . "'";
示例2: mysql_fetch_assoc
$row = mysql_fetch_assoc($result);
if (!$row) {
alertInfo('您要删除的订单不存在', 'userorder.php?key=' . $key . $url, 0);
} else {
$sql2 = "delete from qiyu_order where order_id=" . $v;
if (!mysql_query($sql2)) {
alertInfo('删除失败!原因:SQL删除失败。', "", 1);
}
}
}
alertInfo('删除成功', 'userorder.php?key=' . $key . $url, 0);
break;
case 'xxfinish':
//批量完成
$idlist = $_POST['idlist'];
$key = sqlReplace(trim($_GET['key']));
if (!$idlist) {
alertInfo('请选择', 'userorder.php?key=' . $key . $url, 0);
}
foreach ($idlist as $k => $v) {
$sql3 = "select * from qiyu_order where order_id ='" . $v . "' and order_status='1'";
$rs3 = mysql_query($sql3);
$row3 = mysql_fetch_assoc($rs3);
if (!$row3) {
alertInfo('订单不存在', 'userorder.php?key=' . $key . $url, 0);
} else {
$order = $row3['order_id2'];
$sql2 = "update qiyu_order set order_status='4' where order_id='" . $v . "' and order_status='1'";
if (mysql_query($sql2)) {
//添加订单记录
$orderContent = "<span class='greenbg'><span><span>订单已完成</span></span></span>";
示例3: sqlReplace
<?php
require_once "usercheck.php";
$shopID = sqlReplace(trim($_GET['shopID']));
$sql = "select * from qiyu_shop where shop_id=" . $shopID . " and shop_status='1'";
$rs = mysql_query($sql);
$rows = mysql_fetch_assoc($rs);
if (!$rows) {
alertInfo("错误", "index.php", 0);
}
if (!empty($QIYU_ID_USER)) {
$sqlStr = "select * from qiyu_user where user_id=" . $QIYU_ID_USER;
$result = mysql_query($sqlStr);
$row = mysql_fetch_assoc($result);
if ($row) {
$user_phone = $row['user_phone'];
}
} else {
$user_phone = $_SESSION['user_phone'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css"/>
<script src="js/jquery-1.3.1.js" type="text/javascript"></script>
<title> 验证手机号 - <?php
echo $SHOP_NAME;
?>
- <?php
示例4: sqlReplace
/**
* userlogin_do.php 登录操作
*/
require 'include/dbconn.php';
$user_account = sqlReplace(trim($_POST['z_phone']));
$loginUrl = $_SESSION['login_url'];
$pw = sqlReplace(trim($_POST['pw']));
$cookie = empty($_POST['cookie']) ? "" : sqlReplace($_POST['cookie']);
$re_name = empty($_POST['re_name']) ? "" : sqlReplace($_POST['re_name']);
$sinaUid = empty($_SESSION['sinaUid']) ? '' : sqlReplace($_SESSION['sinaUid']);
$sinaNick = empty($_SESSION['sinaNick']) ? '' : sqlReplace($_SESSION['sinaNick']);
$p = empty($_GET['p']) ? '' : sqlReplace(trim($_GET['p']));
//从订单页来的标示
$shopID = empty($_GET['shopID']) ? '0' : sqlReplace(trim($_GET['shopID']));
$shopSpot = empty($_GET['shopSpot']) ? '0' : sqlReplace(trim($_GET['shopSpot']));
$shopCircle = empty($_GET['shopCircle']) ? '0' : sqlReplace(trim($_GET['shopCircle']));
checkData($user_account, '手机号', 1);
checkData($pw, '密码', 1);
$sqlStr = "select * from " . WIIDBPRE . "_user where user_account='" . $user_account . "'";
$result = mysql_query($sqlStr) or die("查询失败,请检查SQL语句。");
$row = mysql_fetch_assoc($result);
if ($row) {
$ip = $_SERVER['REMOTE_ADDR'];
$pwd = md5(md5($pw . $row['user_salt']));
$sql = "select * from qiyu_user where user_account='" . $user_account . "' and user_password='" . $pwd . "'";
$rs = mysql_query($sql);
$rows = mysql_fetch_assoc($rs);
if ($rows) {
$sql2 = "update qiyu_user set user_experience=user_experience+" . expUserLogin . " where user_account='" . $user_account . "' and user_password='" . $pwd . "'";
mysql_query($sql2);
date_default_timezone_set('PRC');
示例5: sqlReplace
<?php
/**
* demand.php 提交需求
*/
require 'include/dbconn.php';
$content = sqlReplace(trim($_GET['content']));
checkData($content, '内容', 1);
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "insert into " . WIIDBPRE . "_demand(demand_content,demand_addtime,demand_ip) values('" . $content . "',now(),'" . $ip . "')";
$rs = mysql_query($sql);
if (!$rs) {
//alertInfo('此收藏已不存在',"usercenter.php?tab=4",0);
echo '未知原因,提交失败';
} else {
echo '感谢您的关注,我们会尽快开发您周边的餐厅';
}
示例6: sqlReplace
<?php
/**
* userintro.php
*/
require_once "usercheck2.php";
$id = sqlReplace(trim($_GET['id']));
$tel = empty($_GET['tel']) ? '' : sqlReplace(trim($_GET['tel']));
$page = empty($_GET['page']) ? '' : sqlReplace(trim($_GET['page']));
$id = checkData($id, "ID", 0);
$sql = "select * from " . WIIDBPRE . "_user where user_id=" . $id;
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
if (!$row) {
alertInfo('该用户已经不存在', '', 1);
} else {
$account = $row['user_account'];
$name = $row['user_name'];
$mail = $row['user_mail'];
$type = $row['user_type'];
$logintime = $row['user_logintime'];
$loginip = $row['user_loginip'];
$logincount = $row['user_logincount'];
$phone = $row['user_phone'];
$time = $row['user_time'];
$score = $row['user_score'];
$experience = $row['user_experience'];
}
//原版
//$url="&start=".$start."&end=".$end."&name=".$name."&phone=".$phone."&order=".$order."&uid=".$id;
$url = "&name=" . $name . "&phone=" . $phone . "&uid=" . $id;
示例7: sqlReplace
<?php
/**
* 管理员登录
*
* @version v0.01
* @create time 2011-5-16
* @update time
* @author jiangting
* @copyright Copyright (c) 微普科技 WiiPu Tech Inc. (http://www.wiipu.com)
*/
require_once '../conn/conn2.php';
require_once 'inc_function.php';
$name = sqlReplace(trim($_POST['name']));
$passwd = sqlReplace(trim($_POST['pwd']));
//$code=trim($_POST['code']);
$sql = "select * from admin_manage where name='" . $name . "' and passwd='" . md5($passwd) . "' and role=3";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row) {
$_SESSION['name'] = $name;
$_SESSION['role'] = $row['role'];
$sql = "update admin_manage set last_ip=now_ip,now_ip='{$_SERVER[REMOTE_ADDR]}',time=now_time,now_time=NOW(),log_num=log_num+1 where id={$row['id']};";
mysql_query($sql) or die("{$row['id']}");
if ($row['role'] == 1) {
$_SESSION["role_area"] = "超级管理员";
} else {
if ($row["role"] == 3) {
$sql = "select name from mall where id={$row['mall_id']}";
$result = mysql_query($sql) or die("未知原因查询失败");
$mall = mysql_fetch_array($result);
$_SESSION["role_area"] = $mall["name"];
示例8: sqlReplace
<?php
/**
* area_ajax.php
*/
require '../include/dbconn.php';
$str = '';
$act = $_POST['act'];
if ($act == "circle") {
$area_id = sqlReplace(trim($_POST['area_id']));
checkData($area_id, "ÇøÓòID", 0);
$sql = "select ac.areacircle_circle,c.circle_name from " . WIIDBPRE . "_areacircle ac," . WIIDBPRE . "_circle c where ac.areacircle_circle=c.circle_id and areacircle_area=" . $area_id;
$rs = mysql_query($sql);
while ($rows = mysql_fetch_assoc($rs)) {
$str .= "<option value='" . $rows['areacircle_circle'] . "'>" . $rows['circle_name'] . "</option>";
}
}
if ($act == "spot") {
$circle_id = sqlReplace(trim($_POST['circle_id']));
$sql = "select spot_id,spot_name from " . WIIDBPRE . "_spot where spot_circle=" . $circle_id;
$rs = mysql_query($sql);
while ($rows = mysql_fetch_assoc($rs)) {
$str .= "<option value='" . $rows['spot_id'] . "'>" . $rows['spot_name'] . "</option>";
}
}
echo $str;
示例9: empty
}
if (!(empty($site_wiiyunsalt) || empty($site_wiiyunaccount) || $site_sms != '1')) {
// 检测微云码与账号是否正确
$result = $o->checkWiiyunSalt($site_wiiyunsalt, $site_wiiyunaccount);
$r_status = $result[0]->status;
if ($r_status !== 'no') {
$userID2 = $result[0]->id2;
//用户ID2
$sms = $o->getSMS($userID2);
$s_status = $sms[0]->status;
}
}
$userID2 = $result[0]->id2;
$sms = $o->getSMS($userID2);
$s_status = $sms[0]->status;
$act = empty($_GET['act']) ? '' : sqlReplace(trim($_GET['act']));
$telstr = '';
if ($act == 'yes') {
if ($site_sms == '2') {
alertInfo('短信功能未开启,请配置', "site_sms.php", 0);
}
if (empty($_POST["idlist"])) {
alertInfo('请选择群发项!', "", 1);
}
$listall = $_POST["idlist"];
foreach ($listall as $listid) {
$sqlStr = "select * from qiyu_user where user_id in({$listid})";
$result = mysql_query($sqlStr);
$row = mysql_fetch_array($result);
if (!$row) {
alertInfo('数据不存在', '', 1);
示例10: sqlReplace
$str .= "\t\t<p class='cart_intro'><textarea id=\"cart_desc\" class='cart_input'></textarea></p>";
$str .= "\t\t<p class='submit_cart'><img src=\"images/button/addCart1.jpg\" onmouseout=\"checkbg1()\" onmouseover=\"checkbg2()\" mousedown='checkbg3()' id=\"addCartF\" alt=\"\" style='cursor:pointer;' onClick=\"addCart_t_new(" . $shopID . "," . $foodID . "," . $spotID . "," . $circleID . ",'" . $time1 . "','" . $time2 . "')\"/><span><a href='javascript:void();' onClick=\"closeFlow()\">回到餐厅界面</a></span></p>";
$str .= "\t</div>";
echo $str;
break;
case "getTags":
//模板2的餐品口味选择
$shopID = sqlReplace(trim($_POST['shopID']));
$where = '';
$foodID = sqlReplace(trim($_POST['foodID']));
$spotID = sqlReplace(trim($_POST['spotID']));
$circleID = sqlReplace(trim($_POST['circleID']));
$time1 = sqlReplace(trim($_POST['time1']));
$time2 = sqlReplace(trim($_POST['time2']));
$name = sqlReplace(trim($_POST['name']));
$price = sqlReplace(trim($_POST['price']));
$str = "<div id=\"container\">";
$str .= "\t<div id='newCartBox'>";
$str .= "\t\t<div id='c_table'>";
$str .= "\t\t\t<table border='0' width='455'>";
$str .= "\t\t\t\t<tr>";
$str .= "\t\t\t\t\t<td class='menu first td' width='195'>菜名</td>";
$str .= "\t\t\t\t\t<td class='menu' >价格</td>";
$str .= "\t\t\t\t</tr>";
$str .= "\t\t\t\t<tr>";
$str .= "\t\t\t\t\t<td class='main first td'>" . $name . "</td>";
$str .= "\t\t\t\t\t<td class='main'>" . $price . "</td>";
$str .= "\t\t\t\t</tr>";
$str .= "\t\t\t</table>";
$str .= "\t\t</div>";
$str .= "<div id=\"cart_needs\"><span class='span span_need'>口味需求:</span>";
示例11: sqlReplace
<?php
/**
* food.php
*/
require_once "usercheck2.php";
$type = sqlReplace($_GET['type']);
if ($type == '1') {
$title = '营业执照';
} else {
if ($type == '2') {
$title = '卫生许可证';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../style.css" type="text/css"/>
<script src="../js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="../js/tree.js" type="text/javascript"></script>
<script type="text/javascript" src="js/upload.js"></script>
<script type="text/javascript">
<!--
function ajaxFileUpload()
{
$.ajaxFileUpload
(
{
url:'shop_cartpicup1.php',
示例12: sqlReplace
$worksheet->write($i, 9, $getvalue);
$i += 1;
}
$worksheet->write($i, 0, '总计');
$worksheet->write($i, 1, '');
$worksheet->write($i, 2, '');
$worksheet->write($i, 3, '');
$worksheet->write($i, 4, '');
$worksheet->write($i, 5, $orderDeliverTotal);
$worksheet->write($i, 6, $orderALLTotal1);
$worksheet->write($i, 7, $orderMoneyTotal1);
$worksheet->write($i, 8, $spendvalueTotal1);
$worksheet->write($i, 9, $getvalueTotal1);
$workbook->close();
$str = "S";
break;
case "sendcode":
$phone = sqlReplace(trim($_POST['phone']));
$vercodePhone = getRndCode_r(6);
$content = "验证码是" . $vercodePhone;
$sql = "update qiyu_shop set shop_code='" . $vercodePhone . "' where shop_id=" . $QIYU_ID_SHOP;
if (mysql_query($sql)) {
//发送验证码
sendCode($phone, $content);
$str = "S";
} else {
$str = "E";
}
break;
}
echo $str;
示例13: alertInfo
for ($x = 1; $x <= $i; $x++) {
$id = $_POST['id' . $x];
$order = $_POST['order' . $x];
$sql = "update " . WIIDBPRE . "_food set food_order=" . $order . " where food_id=" . $id;
if (!mysql_query($sql)) {
alertInfo('未知原因保存失败! ', "foodspecial_list.php", 0);
}
}
alertInfo('保存排序成功!', "", 1);
break;
case "card1":
$upfile1 = sqlReplace(trim($_POST['upfile']));
checkData($upfile1, '营业执照', 1);
$sql = "update qiyu_shop set shop_certpic='" . $upfile1 . "',shop_certtime=now() where shop_id=" . $QIYU_ID_SHOP;
if (mysql_query($sql)) {
alertInfo("提交成功", "shopcard.php", 0);
} else {
alertInfo("提交失败", "", 1);
}
break;
case "card2":
$upfile2 = sqlReplace(trim($_POST['upfile']));
checkData($upfile2, '卫生许可证', 1);
$sql = "update qiyu_shop set shop_licensepic='" . $upfile2 . "',shop_licensetime=now() where shop_id=" . $QIYU_ID_SHOP;
if (mysql_query($sql)) {
alertInfo("提交成功", "shopcard.php", 0);
} else {
alertInfo("提交失败", "", 1);
}
break;
}
示例14: sqlReplace
<?php
/**
* shoporder.php
*/
require_once "usercheck2.php";
$key = sqlReplace(trim($_GET['key']));
$keyword = empty($_GET['keyword']) ? '' : sqlReplace(trim($_GET['keyword']));
$start = empty($_GET['start']) ? '' : sqlReplace(trim($_GET['start']));
$end = empty($_GET['end']) ? '' : sqlReplace(trim($_GET['end']));
$url = "?key=" . $key . "&keyword=" . $keyword . "&start=" . $start . "&end=" . $end;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../style.css" type="text/css"/>
<script src="../js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="../js/tree.js" type="text/javascript"></script>
<title>订单管理 - 外卖点餐系统</title>
</head>
<body>
<script type="text/javascript">
<!--
function updateOrder(orderID){
var content="<tr id='update'"+orderID+" class='addtr'><td colspan='8' class='border_left border_bottom border_right order1' style='padding:10px;'><textarea name=\"content\" style=\"width:350px;height:100px;\" id='orderIntro'></textarea> <p><a href='javascript:void();' onClick=\"addOrderIntro("+orderID+")\"><img src=\"../images/button/update.jpg\" /></a></p></td></tr>";
$('.addtr').remove();
$(content).insertAfter('#table'+orderID);
}
function addOrderIntro(id){
示例15: sqlReplace
<?php
/**
* shopreg_do.php
*/
require_once "../include/dbconn.php";
$act = sqlReplace(trim($_GET['act']));
switch ($act) {
case "login":
$account = sqlReplace(trim($_POST['account']));
$pwd = sqlReplace(trim($_POST['pw']));
checkData($account, '用户名', 1);
checkData($pwd, '密码', 1);
$code = sqlReplace(trim($_POST["imgcode"]));
//验证码
if (empty($code)) {
alertInfo('验证码不能为空', "", 1);
}
if ($code != $_SESSION['imgcode']) {
alertInfo('验证码不正确,请检查!', "", 1);
}
$sql = "select * from qiyu_shop where shop_account='" . $account . "'";
$rs = mysql_query($sql);
$rows = mysql_fetch_assoc($rs);
if ($rows) {
$salt = $rows['shop_salt'];
$pw = md5(md5($pwd) . $salt);
$sqlStr = "select * from qiyu_shop where shop_account='" . $account . "' and shop_password='" . $pw . "'";
$rs_r = mysql_query($sqlStr);
$row = mysql_fetch_assoc($rs_r);
if ($row) {