intenet.php 704 B

123456789101112131415161718
  1. <?php
  2. //scope=snsapi_userinfo实例
  3. $appid=$_GET["appid"];
  4. $zfopenid = $_GET["zfopenid"];
  5. $kfopenid = $_GET["kfopenid"];
  6. $toUsername = $_GET["toUsername"];
  7. $json = file_get_contents('json/'.$toUsername.'.json');
  8. //echo $json;
  9. $arr = json_decode($json,true);
  10. $website=$arr['website'];
  11. $kfname = $_GET["kfname"];
  12. $redirect_uri = urlencode ("$website/addons/qidong_app/project.php?zfopenid=$zfopenid&toUsername=$toUsername&kfopenid=$kfopenid&kfname=$kfname" );
  13. //echo $redirect_uri;
  14. //exit;
  15. $url ="https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
  16. header("Location:".$url);
  17. ?>