<?php
error_reporting(0); 
include("config/wxlist.php");
$code=htmlspecialchars($_GET[code]);
$payurl=$squrl.'/wxapi.html';
$redirect_uri = urlencode ($payurl);
$url ="https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=".$code."#wechat_redirect";
header("Location:".$url);
?>