<?php include './util.php'; if (isset($_GET['activityId'])) { $activityId = $_GET['activityId']; $url = "http://localhost:8080/Act-Bizsvc/rest/activity/detail"; $params = array("activityId" => $activityId); $c = build_post_curl($url, $params); $ret = curl_exec($c); $response_code = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); //echo $response_code; if ($response_code == 200) { $title = $ret['title']; $location = $ret['location']; $hostAccountId = $ret['hostAccountId']; $personLimitation = $ret['personLimitation']; $type = $ret['type']; $category = $ret['category']; $content = $ret['content']; $startDate = $ret['startDate']; } else { if ($reponse_code == 401) { $url = "index.html"; echo "< script language='javascript' type='text/javascript'>"; echo "alert('获取活动失败')"; echo "window.location.href='{$url}'"; echo "< /script>"; } } }
<?php session_start(); include 'util.php'; $url = "http://localhost:8080/Act-Bizsvc/rest/user/getLoginInfo"; $c = build_post_curl($url); $ret = curl_exec($c); $response_code = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); //echo $response_code; if ($response_code == 200) { $url = "index.html"; $_SESSION['username'] = $ret['username']; $_SESSION['uuid'] = $ret['uuid']; echo "< script language='javascript' type='text/javascript'>"; echo "window.location.href='{$url}'"; echo "< /script>"; } else { if ($reponse_code == 401) { echo "< script language='javascript' type='text/javascript'>"; echo "alert('请登录')"; echo "window.history.back(-1)"; echo "< /script>"; } } print_r($ret);