You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
2.1 KiB

<?php
/**
* Created by xiaofu.qin
* email: xiaofu.qin@fanraun.com
* Date: 2017/3/3
* Time: 10:23
* Description: 用户在index.php点击“获取finereport”或者“获取fineBI验证码”按钮的时候提交的个人信息的时候提交的公司、需求、以及个人职能信息,在这里将其保存到pre_common_member_profile表中。
*/
session_start();
define('FINEREPORT', '100');
require_once '../myFunc/mysql_beta.php';
// 判断token是否存在,不存在则表示是表单欺诈
if( !isset($_POST['token']) || $_POST['token'] !== $_SESSION['token']) {
exit('Go home, my boy!');
}
//不允许所公司的变量为空字符串,因为在index.php页面还需要这儿字段来判断用户是否已经填写这些信息呢!
if( !isset($_POST['identical']) || !isset($_POST['motivation']) || !isset($_POST['company']) || !isset($_POST['realname']) || !isset($_SESSION['username']) || empty($_POST['company'])) {
exit('false');
}
/*
* $identical 的值与其所代表的含义如下
* Business : 业务人员
* ITboy : 运维人员
* CIO : CIO或者高层
* Student : 学生
* Other : 其他
*/
$identical = addslashes(htmlspecialchars($_POST['identical']));
/*
* $motivation的值与其所代表的含义如下:
* Company : 企业型用户
* SoftCompany : 软件型公司
* Personal : 个人用户
* 其他 : 用户自己填写的需求文字
*/
$motivation = addslashes(htmlspecialchars($_POST['motivation']));
$company = addslashes(htmlspecialchars($_POST['company']));$realname = addslashes(htmlspecialchars($_POST['realname']));
$uid = $_SESSION['uid'];
$conn = connect();
$sql = "update pre_common_member_profile set `position`=?, field4=?, company=?, realname=? where uid=?";
$stmt = $conn->prepare($sql);
if( !$stmt ) {
exit('wrong');
}
$stmt->bind_param('ssssi', $identical, $motivation, $company, $realname, $uid);
$stmt->execute();
$stmt->store_result();
if( $stmt->affected_rows === 0) {
exit('wrong');
}
//设置session为company变量
$_SESSION['company'] = $company;$_SESSION['realname'] = $realname;
exit('true');