|
- <?php
- require_once "./WxPay.class.php";
- //require_once "../Common/Function.php";
- //①、获取用户openid
- $tools = new JsApiPay();
- $openId = $tools->GetOpenid();
- $state=$_POST['state'];
- file_put_contents('./openid.txt', date("Y-m-d H:i:s")." getOpenid.php有调用--".$openId.PHP_EOL,FILE_APPEND);
- /* $openId='oCVcbv1udkL4iZm-t1h8YMrMDSyU';
- $state=$_GET['state']; */
- if (empty($_COOKIE['wxopenid'])){
- if(setcookie("wxopenid",$openId,0,"/")){
- file_put_contents('./openid.txt', date("Y-m-d H:i:s")." getOpenid.php有调用--设置cookie成功--".$openId.PHP_EOL,FILE_APPEND);
- }
- }
- exit;
- $host='http://'.$_SERVER['HTTP_HOST'];
-
- switch($state){
- case 1:
- $url=$host.'wechat/Api/ORDER_LIST1.ASP?openid='.$openId;
- break;
- case 2:
- $url=$host.'/core/ORDER_DETAIL1.ASP?openid='.$openId;
- break;
- case 3:
- $url=$host.'/wechat/Api/customer_list.php?openid='.$openId;
- break;
- case 4:
- $url=$host.'/core/CUSTOMER_EDIT1.ASP?openid='.$openId;
- break;
- }
- Header("Location: $url");
|