File: /www/wwwroot/www.jwvfm.com/asp/processorder.php
<?php
/**
* Created by xiaoz.
* User: lenovo
* Date: 2018/10/9
* Time: 14:39
* url:mxcloud.com
* QQ2293640950
*/
include_once 'inc.php';
header("Content-type: text/html; charset=utf-8");
if(empty($_POST['qq'])){
echo"qq号不能为空";
exit();
}
$cloths=$_POST['cloths'];
$shoes=$_POST['shoes'];
$qq=$_POST['qq'];
$glasses=$_POST['glasses'];
$DOCUMENT_ROOT=$_SERVER['DOCUMENT_ROOT'];
$cs=0;
$zcs=0;
//设置时区
date_default_timezone_set('Asia/Shanghai');
//按指定格式输出日期
$date=date('Y-m-d H:i');
?>
<!DOCTYPE html>
<html>
<head lang="zh_CN">
<meta charset="UTF-8">
<title>添加内容</title>
</head>
<body>
<h3>添加内容</h3>
<?php
//设置文件输出内容和格式
$out_put_string=$cloths."\t".$shoes."\t".$qq."\t".$glasses."\t".$cs."\t".$zcs."</br>"."\r\n";
//打开文件,(追加模式+二进制模式)
@$fp=fopen("files/orders.txt",'ab');
flock($fp,LOCK_EX);
if(!$fp){
echo "<p><strong>您的数据没有提交完成,请再试一次。</strong></p></body></html>";
exit;
}
//将数据写入到文件
fwrite($fp,$out_put_string,strlen($out_put_string));
flock($fp,LOCK_UN);
//关闭文件流
fclose($fp);
echo "<p>数据保存完成</p>";
header('Refresh:3,Url=admin.php');
echo '3s 后跳转';
?>
</body>
</html>