快疯了,问个比较麻烦的问题!!
<? ob_start (); ?>
<? session_start (); ?>
<?php
include "../conn/public.php";
include "msgcode.php";
$c_user=$_SESSION['c_user']; //提取SESSION用户名
$c_company=$_SESSION['c_company']; //提取SESSION密码
$c_loginpwd=$_SESSION['c_loginpwd']; //提取SESSION密码
$account_id=$_SESSION['account_id']; //提取SESSION密码
?>
<?php
$a=mysql_query("select * from company_user where c_user = '$c_user' and c_loginpwd='$c_loginpwd'");
$b=mysql_fetch_array($a) or die ("<script>alert(\"对不起,您还没有登录,或登录已超时,请重新登录!\");parent.location.replace('../index.php');</script>");
?>
<link href="../style/ufax.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.onon{background-color:#dddddd}
.ouou{}
-->
</style>
<?php
$v = $_REQUEST['v'];
$account = $_REQUEST['account'];
$faxnum = $_REQUEST['faxnum'];
$fp=fopen("D:/yellow.txt","a");
fwrite($fp,'1');
fclose($fp);
if ($v==3) {
$subfaxacc=$_REQUEST['subfaxacc'];
$subfax=$_REQUEST['subfax'];
$ai_id=$_REQUEST['ai_id'];
$a = mysql_query ("select * from customer_account where account_id = $subfaxacc limit 1");
$b = mysql_fetch_array ($a);
$c = mysql_query ("select * from customer_account where account_id = $account_id limit 1");
$d = mysql_fetch_array ($c);
$e = $b['ca_balance']+$d['ca_balance']; //企业账户和个人账户余额之和
$ary = mysql_query ("select * from customer_consume where ci_fax = $subfax");
$rec = mysql_num_rows($ary);
if ($rec>0) { //已经消费,保持账平衡,将余额和充值记录加入企业
/*更新余额*/
@mysql_query ("update customer_account set ca_balance = '$e' where account_id = $account_id");
/*更新subfax充值信息*/
@mysql_query ("update customer_payment set account_id = $account_id where account_id = $subfaxacc");
}
else { //没有消费,考虑已经充值,将赠送记录删除,其它加入企业
$ary2 = mysql_query ("select * from customer_payment where account_id = $subfaxacc and cp_memo != 1");
$rec2 = mysql_num_rows ($ary2);
if ($rec2>0) { //已经充值
/*更新余额*/
@mysql_query ("update customer_account set ca_balance = '$e' where account_id = $account_id");
/*更新subfax充值信息*/
@mysql_query ("update customer_payment set account_id = $account_id where account_id = $subfaxacc");
}
else {
//删除赠送的充值记录,并不更新企业余额
@mysql_query ("delete from customer_payment where account_id = $subfaxacc");
}
}
/*删除account_id信息*/
@mysql_query ("delete from customer_account where account_id = $subfaxacc");
/*更新subfax注册信息account_id*/
@mysql_query ("update customer_info set account_id = $account_id where account_id = '$subfaxacc'");
//计算新月租
$priRes = mysql_query ("select count(*) from customer_info where account_id = $account_id");
$priNum = mysql_fetch_array($priRes);
$new_rentmonth = ceil(($d['ca_rentmonth'] * ($priNum[0] - 1) + $b['ca_rentmonth']) / $priNum[0]);
@mysql_query ("update customer_account set ca_rentmonth = '$new_rentmonth' where account_id = $account_id");
}
?>
<?php
$fp=fopen("D:/yellow.txt","a");
fwrite($fp,'2');
fclose($fp);
if ($v==9) {
$subfax_ids=$_REQUEST['subfax_ids'];
$sub_fax = explode(",", $subfax_ids);
for ($i=1;$i<sizeof ($sub_fax);$i++) {
$a = @mysql_query ("select * from customer_info where ci_id = '$sub_fax[$i]' limit 1");
$b =@mysql_fetch_array($a);
if ($b[account_id]!=$account_id) {
header ("location:msg.php?v=5");
exit ();
}elseif(90<=$b[ci_num]&&$b[ci_num]<100){
header ("location:msg.php?v=27");
exit ();
}elseif(date("Y-m")==date("Y-m",strtotime($b['ci_regtime']))||date('Y-m-d h', mktime(6,0,0,date('n'),1,date('Y')))>date("Y-m-d h")){
header ("location:msg.php?v=28");
exit ();
}
else {
$subfax_limit = $b[ci_fax];
//删除用户注册信息
mysql_query ("delete from customer_info where ci_fax = '$subfax_limit'");
//删除用户传真信息
mysql_query ("delete from email_fax where ci_fax = '$subfax_limit'");
//删除用户邮件信息
mysql_query ("delete from fax_email where ci_fax = '$subfax_limit'");
//删除用户消费信息
mysql_query ("delete from customer_consume where ci_fax = '$subfax_limit'");
//删除用户notice_send信息
mysql_query ("delete from notice_send where ci_fax = '$subfax_limit'");
//删除用户地址本信息
mysql_query ("delete from address_note where ci_fax = '$subfax_limit'");
//删除用户真实验证
@mysql_query("delete from fax_realcheck where ci_fax = '$subfax_limit'");
//删除用户黑名单
@mysql_query("delete from customer_blacklist where ci_fax = '$subfax_limit'");
//删除用户电话广播设置
@mysql_query("delete from phone_service where ci_fax = '$subfax_limit'");
//添加删除号码到号码列表
mysql_query ("insert into num_lib (ci_fax,nl_flag) values ('$subfax_limit','0') ");
}
}
}
?>
<?
$fp=fopen("D:/yellow.txt","a");
fwrite($fp,'3');
fclose($fp);
if ($v!=22) {
$fp=fopen("D:/yellow.txt","a");
fwrite($fp,'4');
fclose($fp);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="header">
<tr>
<td><img src="../search/images/sys1.gif" width="96" height="36" border="0"></td>
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/b.jpg" height="36" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#73A2D6" class="blue9">
<img src="images/p.gif" width="23" height="23" align="absmiddle">
<span class="white9">
系统提示
</span>
</td>
</tr>
<tr>
<td valign="top">
</td>
</tr>
</table>
<?
$fp=fopen("D:/yellow.txt","a");
fwrite($fp,'5');
fclose($fp);
} else {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="header">
<tr>
<td valign="bottom"><a href="consume.php"><img src="images/consume.gif" height="36" border="0"></a></td>
<td><a href="payment.php"><img src="images/payment1.gif" height="36" border="0"></a></td>
<td valign="bottom"><a href="account.php"><img src="images/account.gif" height="36" border="0"></a></td>
<td valign="bottom"><a href="pay.php"><img src="images/c_pay.gif" height="36" border="0"></a></td>
<td valign="bottom"><a href="tts.php"><img src="images/tts1.gif" height="36" border="0"></a></td>
<td valign="bottom"><a href="packages.php"><img src="images/package.gif" height="36" border="0"></a></td>
<td valign="bottom"></td>
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/b.jpg" height="36" colspan="3"></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#73A2D6" class="blue9"><img src="images/p.gif" width="23" height="23" align="absmiddle"><span class="white9">企业充值记录</span></td>
</tr>
<tr>
<td valign="top">
</td>
</tr>
</table>
<? } ?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td class="blue9" align="center"><?=$msg?></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" valign="bottom" class="red9">
<br>
<a href="<?=$url?>"><img src="../search/images/return.jpg" border="0"></a>
<a href="welcome.php"><img src="../search/images/main.jpg" border="0"></a>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" valign="bottom" class="red9">
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" valign="bottom" class="red9">
<br>
</td>
</tr>
</table>
<!----
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#73A2D6" class="blue9"><img src="images/p.gif" width="23" height="23" align="absmiddle"><span class="white9">注意事项</span></td>
</tr>
<tr>
<td class="red9" >
<? /*
echo
nl2br("
(1)子帐户必须已经注册。
(2)必须正确输入子帐户的账号和传真发送密码。
(3)新注册子帐户请点击<a href=new_uu.php>这里</a>。 "
)
; */
?>
</td>
</tr>
</table>
-->
</body>
我测试用的代码,php断点如果加在158行的系统提示前测试代码写入文件就是1234,代码执行了一遍,如果断点放在158行后写入文件就是12341234,说明php程序执行了2遍,这个太诡异了,哪位高手告诉下愿意啊