insert_adv_transaction.php

来自「通达OA部分源代码」· PHP 代码 · 共 37 行

PHP
37
字号
<?
include_once "logincheck.php";
include_once "myconnect.php";

			if (!get_magic_quotes_gpc()) {
			$amount=str_replace('$', '\$',addslashes($_REQUEST["amount"]));
			$description=str_replace('$', '\$',addslashes($_REQUEST["comments"]));
			$email=str_replace('$', '\$',addslashes($_REQUEST["email"]));
			}
			else
			{
			$amount=str_replace('$', '\$',$_REQUEST["amount"]);
			$description=str_replace('$', '\$',$_REQUEST["comments"]);
			$email=str_replace('$', '\$',$_REQUEST["email"]);
			}

$rst=mysql_fetch_array(mysql_query("select * from sbbleads_advertisers where email='$email'"));
if($rst)
{
	$id=$rst["id"];
	mysql_query("insert into sbbleads_adv_transactions (adv_id,amount,description,date_submitted) 
	values ($id,$amount,'$description','".date("Ymdhis",time())."')");
	$msg="Successfully added $".$amount." to member account"; 
	if($amount<0)
	{
	$msg="Successfully deducted $".((-1)*$amount)." from member account"; 
	}
}
else
{
	$msg="No Advertiser found with this email";
	header("Location:"."add_adv_transaction.php?msg=".urlencode($msg));
	die();
}
header("Location:"."view_adv_transactions.php?id=$id&msg=".urlencode($msg));
die();
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?