Server : Apache System : Linux iZ2vcgyutqttsd1p850kl8Z 3.10.0-1160.92.1.el7.x86_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86_64 User : www ( 1000) PHP Version : 5.6.40 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/saimikebio.com/includes/website/ |
<?php session_start(); header("Content-type:text/html; charset=UTF-8;"); define('IN_ECS', true); if (file_exists(dirname(__FILE__).'/config/taobao_config.php')) { include_once(dirname(__FILE__) . '/config/taobao_config.php'); }else{ echo "后台未正确安装或未启用淘宝插件,请联系管理员!<a href='/'>点击返回</a>";exit; } //保存时间请求参数 $state = time(); $_SESSION["tb_state"] = $state; $ret_url = get_auth_url($state); //保存来路URL,最后将返回 $back_url = empty($_GET['callback']) ? "/index.php":$_GET['callback']; $_SESSION["back_url"] = $back_url; header("location:".$ret_url); //页面调用 function get_auth_url($state){ $redirect_url = "http://".$_SERVER["HTTP_HOST"].str_replace("tb_index.php", "tb_callback.php", $_SERVER["REQUEST_URI"]); $url= "https://oauth.taobao.com/authorize";//https://oauth.taobao.com/authorize?response_type=code&client_id=21234035&redirect_uri=http://www.zocms.com/oauthLogin.php&state=1 $params = array( "response_type" => "code", "client_id" => APP_KEY, "redirect_uri" => $redirect_url, "state" => $state ); foreach($params as $key=>$val){ $get[] = $key."=".urlencode($val); } return $url."?".join("&", $get); } ?>