本文整理汇总了PHP中get_domain函数的典型用法代码示例。如果您正苦于以下问题:PHP get_domain函数的具体用法?PHP get_domain怎么用?PHP get_domain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_domain函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_server
/**
* Returns the current server URI including protocol, domain and protocol as a
* string.
*
* @return string
*/
function get_server()
{
$server = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '' ? 'https://' : 'http://';
$server .= get_domain();
$server .= isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '';
return $server;
}
示例2: index
public function index()
{
$user_id = intval($GLOBALS['user_info']['id']);
if (!$user_id) {
app_redirect(url("index"));
}
//返利列表
$page = intval($_REQUEST['p']) > 0 ? intval($_REQUEST['p']) : 1;
$referrals_count = $GLOBALS['db']->getRow("select count(*) as count,sum(score) as total_score from " . DB_PREFIX . "referrals where user_id= " . $user_id . " ");
if ($referrals_count) {
$page_size = ACCOUNT_PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
$sql = "select r.*,u.create_time as register_time from " . DB_PREFIX . "referrals as r " . " left join " . DB_PREFIX . "user as u on u.id=r.user_id " . " where user_id=" . $user_id . " order by id desc limit " . $limit;
$referrals_list = $GLOBALS['db']->getAll($sql);
$page = new Page($referrals_count['count'], $page_size);
//初始化分页类
$p = $page->show();
$GLOBALS['tmpl']->assign("pages", $p);
}
//邀请连接
$referrals_url = get_domain() . APP_ROOT . "/";
if ($GLOBALS['user_info']) {
$referrals_url .= "?ref=" . base64_encode(intval($user_id));
}
$GLOBALS['tmpl']->assign("referrals_url", $referrals_url);
$GLOBALS['tmpl']->assign('referrals_list', $referrals_list);
$GLOBALS['tmpl']->assign('referrals_count', $referrals_count);
$GLOBALS['tmpl']->assign("page_title", "我的邀请");
$GLOBALS['tmpl']->display("referrals_index.html");
}
示例3: index
public function index()
{
$page = intval($_REQUEST['p']);
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
$result = get_invite_list($limit, $GLOBALS['user_info']['id']);
$GLOBALS['tmpl']->assign("list", $result['list']);
$page = new Page($result['count'], app_conf("PAGE_SIZE"));
//初始化分页对象
$p = $page->show();
$GLOBALS['tmpl']->assign('pages', $p);
$total_referral_money = $GLOBALS['db']->getOne("select sum(money) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0");
$total_referral_score = $GLOBALS['db']->getOne("select sum(score) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0");
$GLOBALS['tmpl']->assign("total_referral_money", $total_referral_money);
$GLOBALS['tmpl']->assign("total_referral_score", $total_referral_score);
$GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVITE']);
$GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invite_index.html");
$share_url = get_domain() . APP_ROOT . "/";
if ($GLOBALS['user_info']) {
$share_url .= "?r=" . base64_encode(intval($GLOBALS['user_info']['id']));
}
$GLOBALS['tmpl']->assign("share_url", $share_url);
$GLOBALS['tmpl']->display("uc.html");
}
示例4: get_self_url_easy
/**
* Get a well formed URL equivalent to the current URL. Reads direct from the environment and does no clever mapping at all. This function should rarely be used.
*
* @return URLPATH The URL
*/
function get_self_url_easy()
{
$protocol = tacit_https() ? 'https' : 'http';
if (!isset($_SERVER['HTTP_HOST'])) {
$domain = get_domain();
} else {
$domain = $_SERVER['HTTP_HOST'];
}
$colon_pos = strpos($domain, ':');
if ($colon_pos !== false) {
$domain = substr($domain, 0, $colon_pos);
}
$self_url = $protocol . '://' . $domain;
$port = ocp_srv('SERVER_PORT');
if ($port != '' && $port != '80') {
$self_url .= ':' . $port;
}
$s = ocp_srv('PHP_SELF');
if (substr($s, 0, 1) != '/') {
$self_url .= '/';
}
$self_url .= $s;
if (array_key_exists('QUERY_STRING', $_SERVER) && $_SERVER['QUERY_STRING'] != '') {
$self_url .= '?' . $_SERVER['QUERY_STRING'];
}
return $self_url;
}
示例5: get_payment_code
public function get_payment_code($payment_notice_id)
{
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$order_sn = $GLOBALS['db']->getOne("select order_sn from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
$money = round($payment_notice['money'], 2);
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
$data_vid = trim($payment_info['config']['chinabank_account']);
$data_orderid = $payment_notice['notice_sn'];
$data_vamount = $money;
$data_vmoneytype = 'CNY';
$data_vpaykey = trim($payment_info['config']['chinabank_key']);
$data_vreturnurl = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=Chinabank';
$data_notify_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Chinabank';
$MD5KEY = $data_vamount . $data_vmoneytype . $data_orderid . $data_vid . $data_vreturnurl . $data_vpaykey;
$MD5KEY = strtoupper(md5($MD5KEY));
$payLinks = '<form style="text-align:center;" method=post action="https://pay3.chinabank.com.cn/PayGate" id="jumplink">';
$payLinks .= "<input type=HIDDEN name='v_mid' value='" . $data_vid . "'>";
$payLinks .= "<input type=HIDDEN name='v_oid' value='" . $data_orderid . "'>";
$payLinks .= "<input type=HIDDEN name='v_amount' value='" . $data_vamount . "'>";
$payLinks .= "<input type=HIDDEN name='v_moneytype' value='" . $data_vmoneytype . "'>";
$payLinks .= "<input type=HIDDEN name='v_url' value='" . $data_vreturnurl . "'>";
$payLinks .= "<input type=HIDDEN name='v_md5info' value='" . $MD5KEY . "'>";
$payLinks .= "<input type=HIDDEN name='remark1' value=''>";
$payLinks .= "<input type=HIDDEN name='remark2' value='[url:=" . $data_notify_url . "]'>";
$payLinks .= "正在连接支付接口...</form>";
$payLinks .= '<script type="text/javascript">document.getElementById("jumplink").submit();</script>';
return $payLinks;
}
示例6: show
public function show()
{
$item_id = I("item_id");
$login_user = session("login_user");
$uid = $login_user['uid'] ? $login_user['uid'] : 0;
$this->checkItemVisit($uid, $item_id);
$item = D("Item")->where("item_id = '{$item_id}' ")->find();
//获取所有父目录id为0的页面
$pages = D("Page")->where("cat_id = '0' and item_id = '{$item_id}' ")->order(" `order` asc ")->select();
//获取所有目录
$catalogs = D("Catalog")->where("item_id = '{$item_id}' ")->order(" `order` asc ")->select();
if ($catalogs) {
foreach ($catalogs as $key => &$catalog) {
$temp = D("Page")->where("cat_id = '{$catalog['cat_id']}' ")->order(" `order` asc ")->select();
$catalog['pages'] = $temp ? $temp : array();
}
}
$share_url = get_domain() . __APP__ . '/' . $item_id;
$ItemPermn = $this->checkItemPermn($uid, $item_id);
$ItemCreator = $this->checkItemCreator($uid, $item_id);
$this->assign("ItemPermn", $ItemPermn);
$this->assign("ItemCreator", $ItemCreator);
$this->assign("share_url", $share_url);
$this->assign("catalogs", $catalogs);
$this->assign("pages", $pages);
$this->assign("item", $item);
$this->assign("login_user", $login_user);
$this->display();
}
示例7: execute
function execute(&$request)
{
/* Set the Breadcrumbs bit */
k4_bread_crumbs($request['template'], $request['dba'], 'L_MARKFORUMREAD');
if (isset($_REQUEST['id']) && intval($_REQUEST['id']) > 0) {
$forums = $request['dba']->executeQuery("SELECT * FROM " . K4FORUMS . " WHERE forum_id = " . intval($_REQUEST['id']));
if ($forums->numrows() == 0) {
$action = new K4InformationAction(new K4LanguageElement('L_FORUMDOESNTEXIST'), 'content', FALSE);
return $action->execute($request);
}
} else {
$forums = $request['dba']->executeQuery("SELECT * FROM " . K4FORUMS);
}
$cookiestr = '';
$cookieinfo = get_forum_cookies();
while ($forums->next()) {
$forum = $forums->current();
$cookieinfo[$forum['forum_id']] = time();
}
foreach ($cookieinfo as $key => $val) {
$cookiestr .= ',' . $key . ',' . $val;
}
setcookie(K4FORUMINFO, trim($cookiestr, ','), time() + 2592000, get_domain());
$action = new K4InformationAction(new K4LanguageElement('L_MARKEDFORUMREAD', $forum['name']), 'content', TRUE, referer(), 3);
return $action->execute($request);
}
示例8: get_payment_code
public function get_payment_code($payment_notice_id)
{
define('REAL_APP_ROOT', str_replace('/mapi', "", APP_ROOT));
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$order_sn = $payment_notice['notice_sn'];
$money = round($payment_notice['money'], 2);
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
$sql = "select name " . "from " . DB_PREFIX . "deal " . "where id =" . intval($payment_notice['deal_id']);
$title_name = $GLOBALS['db']->getOne($sql);
$subject = $order_sn;
//$data_return_url = get_domain().APP_ROOT.'/../shop.php?ctl=payment&act=response&class_name=Walipay';
//$notify_url = get_domain().APP_ROOT.'/../shop.php?ctl=payment&act=notify&class_name=Walipay';
$notify_url = get_domain() . REAL_APP_ROOT . "/alipay_web/alipayapi.php?order_id=" . intval($payment_notice['order_id']) . "&out_trade_no=" . $order_sn;
//."&out_trade_no={$data.walipay.out_trade_no}";
$pay = array();
$pay['subject'] = $title_name;
$pay['body'] = $subject;
$pay['total_fee'] = $money;
$pay['total_fee_format'] = format_price($money);
$pay['out_trade_no'] = $payment_notice['notice_sn'];
$pay['notify_url'] = $notify_url;
$pay['partner'] = $payment_info['config']['alipay_partner'];
//合作商户ID
$pay['seller'] = $payment_info['config']['alipay_account'];
//账户ID
$pay['key'] = $payment_info['config']['alipay_key'];
//支付宝(RSA)公钥
$pay['is_wap'] = 1;
$pay['pay_code'] = 'walipay';
//,支付宝;mtenpay,财付通;mcod,货到付款
return $pay;
}
示例9: index
public function index()
{
global $tmpl;
$directory = APP_ROOT_PATH . "dh/";
$read_api = true;
$dir = @opendir($directory);
$apis = array();
while (false !== ($file = @readdir($dir))) {
if (preg_match("/^.*?\\.php\$/", $file)) {
$tmp = (require_once $directory . $file);
if ($tmp) {
$apis[] = $tmp;
}
}
}
@closedir($dir);
unset($read_api);
$contents_html = '<table>';
foreach ($apis as $k => $v) {
foreach ($v['info'] as $kk => $vv) {
$contents_html .= "<tr><td style='padding:10px 25px 10px 5px;'>";
$contents_html .= $vv['name'] . ":</td><td style='padding:10px 5px 10px 5px;'><input type='text' style='width:350px;' class='f-input' value='" . get_domain() . APP_ROOT . "/dh/" . $vv['url'] . "' /></td>";
$contents_html .= "</tr>";
}
}
$contents_html .= '</table>';
$GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['API_LIST']);
$GLOBALS['tmpl']->assign("page_keyword", $GLOBALS['lang']['API_LIST']);
$GLOBALS['tmpl']->assign("page_description", $GLOBALS['lang']['API_LIST']);
$article['title'] = $GLOBALS['lang']['API_LIST'];
$article['content'] = $contents_html;
$GLOBALS['tmpl']->assign("article", $article);
$GLOBALS['tmpl']->display("article.html");
}
示例10: index
public function index()
{
$root = array();
$email = strim($GLOBALS['request']['email']);
//用户名或邮箱
$pwd = strim($GLOBALS['request']['pwd']);
//密码
//检查用户,用户密码
$user = user_check($email, $pwd);
$user_id = intval($user['id']);
if ($user_id > 0) {
$root['user_login_status'] = 1;
$root['response_code'] = 1;
//$root['show_err'] = get_domain();
//输出支付方式
$payment_list = $GLOBALS['db']->getAll("select id,class_name,name,description,logo,total_amount,config from " . DB_PREFIX . "payment order by sort desc");
foreach ($payment_list as $k => $v) {
$payment_list[$k]['logo'] = get_domain() . $v['logo'];
}
$root['payment_list'] = $payment_list;
} else {
$root['response_code'] = 0;
$root['show_err'] = "未登录";
$root['user_login_status'] = 0;
}
output($root);
}
示例11: get_payment_code
public function get_payment_code($payment_notice_id)
{
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$order_sn = $GLOBALS['db']->getOne("select order_sn from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
$money = round($payment_notice['money'], 2);
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
$data_vid = trim($payment_info['config']['chinabank_account']);
$data_orderid = $payment_notice['notice_sn'];
$data_vamount = $money;
$data_vmoneytype = 'CNY';
$data_vpaykey = trim($payment_info['config']['chinabank_key']);
$data_vreturnurl = get_domain() . APP_ROOT . '/shop.php?ctl=payment&act=response&class_name=Chinabank';
$data_notify_url = get_domain() . APP_ROOT . '/shop.php?ctl=payment&act=notify&class_name=Chinabank';
$MD5KEY = $data_vamount . $data_vmoneytype . $data_orderid . $data_vid . $data_vreturnurl . $data_vpaykey;
$MD5KEY = strtoupper(md5($MD5KEY));
$payLinks = '<form style="text-align:center;" method=post action="https://pay3.chinabank.com.cn/PayGate" target="_blank">';
$payLinks .= "<input type=HIDDEN name='v_mid' value='" . $data_vid . "'>";
$payLinks .= "<input type=HIDDEN name='v_oid' value='" . $data_orderid . "'>";
$payLinks .= "<input type=HIDDEN name='v_amount' value='" . $data_vamount . "'>";
$payLinks .= "<input type=HIDDEN name='v_moneytype' value='" . $data_vmoneytype . "'>";
$payLinks .= "<input type=HIDDEN name='v_url' value='" . $data_vreturnurl . "'>";
$payLinks .= "<input type=HIDDEN name='v_md5info' value='" . $MD5KEY . "'>";
$payLinks .= "<input type=HIDDEN name='remark1' value=''>";
$payLinks .= "<input type=HIDDEN name='remark2' value='[url:=" . $data_notify_url . "]'>";
if (!empty($payment_info['logo'])) {
$payLinks .= "<input type='image' src='" . APP_ROOT . $payment_info['logo'] . "' style='border:solid 1px #ccc;'><div class='blank'></div>";
}
$payLinks .= "<input type='submit' class='paybutton' value='前往网银在线支付'>";
$payLinks .= "</form>";
$code = '<div style="text-align:center">' . $payLinks . '</div>';
$code .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
return $code;
}
示例12: __construct
public function __construct($api)
{
$api['config'] = unserialize($api['config']);
$this->api = $api;
//回调地址要用urlencode编码
$this->redirback = urlencode(get_domain() . APP_ROOT . "/api_callback.php?c=Qq");
}
示例13: index
public function index()
{
$filenamezip = APP_ROOT_PATH . "public/mobile_goods_down_region_conf.zip";
if (!file_exists($filenamezip)) {
$sql = "select id,pid,name,'' as postcode,'' as py from " . DB_PREFIX . "delivery_region";
$list = $GLOBALS['db']->getAll($sql);
$root = array();
$root['return'] = 1;
$region_list = "";
foreach ($list as $item) {
$sql = "insert into region_conf(id,pid,name,postcode,py) values('{$item['id']}','{$item['pid']}','{$item['name']}','{$item['postcode']}','{$item['py']}');";
if ($region_list == "") {
$region_list = $sql;
} else {
$region_list = $region_list . "\n" . $sql;
}
}
$ziper = new zipfile();
$ziper->addFile($region_list, "region_conf.txt");
$ziper->output($filenamezip);
}
$root = array();
$root['return'] = 1;
if (file_exists($filenamezip)) {
$root['file_exists'] = 1;
} else {
$root['file_exists'] = 0;
}
$sql = "select count(*) as num from " . DB_PREFIX . "delivery_region";
$root['region_num'] = $GLOBALS['db']->getOne($sql);
//配置地区数量
$root['file_url'] = get_domain() . APP_ROOT . "/../public/mobile_goods_down_region_conf.zip";
$root['file_size'] = abs(filesize($filenamezip));
output($root);
}
示例14: check_image_url
function check_image_url($url = false, $facebook_id = false, $google_picture_link = false, $twitter_picture_link = false, $imgur_img_type = false)
{
if ($url != false) {
// ถ้าลิ้งค์รูปเป็นลิ้งค์ของ imgur.com
if (get_domain($url) == "imgur.com") {
if ($imgur_img_type == "original") {
return $url;
// รูปดั้งเดิม
} else {
// หาไอดีรูป เพื่อทำ thumbnail
$array = parse_url($url);
$imgThumb = substr($array['path'], 1, -4) . 'b';
$imgType = substr($url, strrpos($url, ".") + 1);
return "http://i.imgur.com/" . $imgThumb . "." . $imgType;
}
} else {
return $url;
}
// return site_url("media/timthumb/timthumb.php?src=".$url."&zc=1&w=120&h=120");
} elseif ($facebook_id != false) {
return "https://graph.facebook.com/" . $facebook_id . "/picture?type=large";
// return site_url("media/timthumb/timthumb.php?src=https://graph.facebook.com/".$facebook_id."/picture?type=large&zc=1&w=120&h=120");
} elseif ($google_picture_link != false) {
return "{$google_picture_link}";
} elseif ($twitter_picture_link != false) {
return $twitter_picture_link;
}
}
示例15: Tencent
function Tencent()
{
require_once APP_ROOT_PATH . 'system/api_login/Tencent/Tencent.php';
OAuth::init($GLOBALS['m_config']['tencent_app_key'], $GLOBALS['m_config']['tencent_app_secret']);
$openid = trim($GLOBALS['request']['openid']);
$openkey = trim($GLOBALS['request']['openkey']);
if ($GLOBALS['m_config']['tencent_bind_url'] == "") {
$app_url = get_domain() . APP_ROOT . "/api_callback.php?c=Tencent";
} else {
$app_url = $GLOBALS['m_config']['tencent_bind_url'];
}
$access_token = trim($GLOBALS['request']['access_token']);
es_session::set("t_access_token", $access_token);
es_session::set("t_openid", $openid);
es_session::set("t_openkey", $openkey);
if (es_session::get("t_access_token") || es_session::get("t_openid") && es_session::get("t_openkey")) {
$r = Tencent::api('user/info');
$r = json_decode($r, true);
$name = $r['data']['name'];
if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where tencent_id = '" . $name . "'") == 0) {
$GLOBALS['db']->query("update " . DB_PREFIX . "user set t_access_token ='" . $access_token . "',t_openkey = '" . $openkey . "',t_openid = '" . $openid . "', tencent_id = '" . $name . "' where id =" . intval($GLOBALS['user_info']['id']));
} elseif (intval($GLOBALS['db']->getOne("select id from " . DB_PREFIX . "user where tencent_id = '" . $name . "'")) == intval($GLOBALS['user_info']['id'])) {
$GLOBALS['db']->query("update " . DB_PREFIX . "user set t_access_token ='" . $access_token . "',t_openkey = '" . $openkey . "',t_openid = '" . $openid . "', tencent_id = '" . $name . "' where id =" . intval($GLOBALS['user_info']['id']));
} else {
$root['return'] = 0;
$root['info'] = "该微博帐号已被其他会员绑定";
output($root);
}
}
$root['return'] = 1;
$root['info'] = "绑定成功";
$root['login_type'] = "Tencent";
output($root);
}