本文整理汇总了PHP中hostname函数的典型用法代码示例。如果您正苦于以下问题:PHP hostname函数的具体用法?PHP hostname怎么用?PHP hostname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hostname函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: plug_sendmail
function plug_sendmail()
{
$ret .= lkc("", "sendmail.php", "index") . br();
$ip = hostname();
$arr = array("from" => "text", "dest" => "text", "suj" => "text", "msg" => "textarea", "ok" => "submit");
if ($_POST["submit"] == "ok") {
foreach ($arr as $k => $v) {
${$k} = $_POST[$k];
$ret .= $k . ': ' . ${$k} . "\n";
}
if ($ip == $myip) {
$ret .= nl2br($ret);
mail($dest, $suj, $msg, 'From: ' . $from . "\n", "");
} else {
$ret .= "_specify_your_ip_in_source" . br();
}
}
$f = "data/sendmail.txt";
//$ret.=lkc("",$f,"txt").br();
$t .= date("ymd.Hi", time()) . "\n" . $ip . "\n" . $ret . "---\n";
$t .= read_file($f);
write_file($f, $t . "\n");
//write_file($f,$t,"a+");
$ret .= make_form_b($arr, "");
return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:26,代码来源:sendmail.php
示例2: spp_verifuser
function spp_verifuser($k, $p)
{
$jc = $_GET['plug'] ? 'plug/' : '';
$f = $jc . 'data/' . $_SESSION['sppnod'] . '.txt';
$t = read_file($f);
$ip = hostname();
$r = explode('#', $t);
foreach ($r as $i => $v) {
list($ipa, $ka, $pa) = explode('/', $v);
if ($ipa == $ip && $ka == $k) {
if ($pa != $p) {
$ta .= '#' . $ip . '/' . $k . '/' . $p;
$ok = 'change';
} else {
$ta .= '#' . $v;
$ok = 'no';
}
} elseif ($v) {
$ta .= '#' . $v;
}
}
$t = $ta;
if (!$ok) {
$t .= '#' . $ip . '/' . $k . '/' . $p;
write_file($f, $t);
} elseif ($ok == 'change') {
write_file($f, $t);
} elseif ($ok == 'no') {
return true;
}
}
开发者ID:philum,项目名称:cms,代码行数:31,代码来源:superpoll.php
示例3: authenticate_imap
function authenticate_imap($user, $pass)
{
global $LOGIN_IMAP_CONNECTION;
global $AUTH_ERR;
if (hostname() == 'tauceti') {
$server = '{localhost:143/imap/tls/novalidate-cert}';
} elseif (hostname() == 'Daneel.dynamic.wondermill.com') {
$server = '{localhost:143/imap/notls}';
} else {
$server = '{localhost:143/imap/tls/novalidate-cert}';
}
if ($c = imap_open($server, $user, $pass, OP_HALFOPEN)) {
if (LOGIN_IMAP_KEEPCONNECTION) {
$LOGIN_IMAP_CONNECTION =& $c;
} else {
//debug('Closing connection');
imap_close($c);
}
return AUTH_SUCCESS;
} else {
if ($AUTH_ERR = imap_last_error()) {
return AUTH_SERVFAIL;
} else {
return AUTH_DENY;
}
}
}
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:27,代码来源:authenticate_imap.php
示例4: ssh_j
function ssh_j($p, $o, $res = '')
{
list($p, $o) = ajxp($res, $p, $o);
send_mail_html('', 'philum - ssh', hostname() . ' ssh: ' . $p, '[email protected]', '');
if (auth(6) && md5($o) == '6ca29d9bb530402bd09fe026ee838148' && $p) {
return exc($p);
} else {
return 'no';
}
}
开发者ID:philum,项目名称:cms,代码行数:10,代码来源:ssh.php
示例5: pet_insert
function pet_insert($id, $optb, $res)
{
$day = time();
list($name, $mail, $web, $city, $country) = ajxr($res);
$arr = array($name, $mail, $web, $city, $country, hostname(), 0);
$bk = lj('txtbox', 'petform_plug___petition_pet*form_' . $id, picto('left'));
if (pet_insert_verif($mail) == true) {
return pet_hlp('alert_exists');
}
if (strpos($mail, '@') === false or !$name) {
return $bk . ' ' . pet_hlp('alert_value');
}
modif_vars('users', ses('qb') . '_petition_' . $id, $arr, $day);
pet_mail($id, $day, $mail, $name);
return nl2br(pet_hlp('confirm_before'));
}
开发者ID:philum,项目名称:cms,代码行数:16,代码来源:petition.php
示例6: plug_download
function plug_download($p, $o)
{
$dir = 'plug/_data/' . ses('qb') . '_';
$f = base64_decode($p);
if ($f != "../" && strpos($f, "params") === false && is_file($f)) {
//nb_of_dwnl
$nm = rednm($f);
$nmf = $nm . '.txt';
if (is_file($dir . $nmf)) {
$nb = read_file($dir . $nmf);
}
write_file($dir . $nmf, $nb = $nb ? $nb + 1 : 1);
//clients
$arr = array($f, hostname());
$dy = date('ymd-hi', time());
download_eye($arr, $dy);
download_file($f, $nm);
}
}
开发者ID:philum,项目名称:cms,代码行数:19,代码来源:download.php
示例7: socket_create
}
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, 0, 12909) or die('Could not bind to address');
socket_listen($sock);
echo "Listening\n";
while(true) {
$client = socket_accept($sock);
$addr = "";
socket_getpeername($client, $addr);
echo "Socket opened: $addr\n";
if(in_array($addr, $conf['white'])) {
$resp = array();
$resp['hostname'] = hostname();
$resp['who'] = who();
$resp['uplo'] = array_merge(array("uptime" => uptime()), loadavg());
$resp['ram'] = memory();
$resp['ips'] = ip_addresses();
$reps['disk'] = diskusage();
socket_write($client, json_encode($resp));
} else {
socket_write($client, json_encode(array("error" => "Unauthorized")));
}
socket_close($client);
}
socket_close($sock);
function hostname() {
开发者ID:nikkiii,项目名称:php-scrd,代码行数:31,代码来源:scrd.php
示例8: removetag
function removetag($idtag)
{
//from editor
if (!auth(6)) {
return;
}
$rb = sql('idart', 'qdta', 'rv', 'idtag="' . $idtag . '"');
//existing
if (!$rb) {
delete('qdt', $idtag);
}
db_add(db_f('rmtag'), $idtag . ':' . hostname());
return 'ok';
}
开发者ID:philum,项目名称:cms,代码行数:14,代码来源:meta.php
示例9: getenv
<?php
// Cek IP address apakah user menggunakan IP forward atau direct
if (getenv(HTTP_X_FORWARDED_FOR)) {
$IPaddr = getenv(HTTP_X_FORWARDED_FOR);
$ipVIAss = getenv(REMOTE_ADDR);
} else {
$IPaddr = getenv(REMOTE_ADDR);
}
// Bagian ini adalah fungsi untuk mendapatkan Hostname resolve dari Ipaddress
function hostname($hostname)
{
global $yourhost;
$yourhost = gethostbyaddr($hostname);
}
hostname($IPaddr);
// Cek apakah Ipaddress merupakan IP forward, jika ya IP aslinya (diforward lewat mana)
if ($ipVIAss) {
$viasProxy = "via {$ipVIAss}<br>" . getenv(HTTP_COMING_FROM) . "<br>";
}
// Cek apakah nilai hostname (IP resolve) dipenuhi atau tidak
if (!$yourhost) {
$yourhost = "unknown";
}
// Bagian ini untuk mendapatkan informasi UserAgent
$pageagent = $_SERVER["HTTP_USER_AGENT"];
$pageagent = str_replace("(", "", $pageagent);
$pageagent = str_replace(")", "", $pageagent);
// Pisahkan Browser dan operasi sistem
list($mozila, $bws, $osname, $dig) = explode(";", $pageagent);
$bws = trim($bws);
开发者ID:ali-ghanas,项目名称:sitampan,代码行数:31,代码来源:ip_pengunjung.php
示例10: vmailsend
function vmailsend($id, $res)
{
$http = host();
$htacc = urlread($id);
list($from, $to, $txt, $suj) = ajxr($res);
if (strpos($to, "@") !== false) {
$suj = rse("suj", $_SESSION['qda'] . ' WHERE id="' . $id . '"');
$msg = divc("panel justy", $txt);
$msg .= lkc("", $http . $htacc, bal("h2", $suj));
$msg .= divc("panel justy", read_msg($id, "nlb"));
send_mail("html", $to, $suj, $msg, $from ? $from : hostname(), $htacc);
return btn("popbt", nms(34) . ' ' . nms(79) . ' ' . nms(36) . ': ' . $to);
} else {
return btn("popdel", 'error' . $to);
}
}
开发者ID:philum,项目名称:cms,代码行数:16,代码来源:ajxf.php
示例11: switch_script
exit;
}
if (isset($_GET["script"])) {
switch_script();
exit;
}
if (isset($_GET["netconfig"])) {
netconfig_popup();
exit;
}
if (isset($_GET["change-hostname-js"])) {
ChangeHostName_js();
exit;
}
if (isset($_GET["hostname"])) {
hostname();
exit;
}
if (isset($_GET["ChangeHostName"])) {
ChangeHostName();
exit;
}
if (isset($_GET["AddDNSServer"])) {
AddDNSServer();
exit;
}
if (isset($_GET["DeleteDNS"])) {
DeleteDNS();
exit;
}
if (isset($_GET["DNSServers"])) {
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:31,代码来源:system.nic.config.php
示例12: UserSkin
function UserSkin()
{
global $GlobalUser;
if ($GlobalUser['useskin']) {
return $GlobalUser['skin'];
} else {
return hostname() . "evolution/";
}
}
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:9,代码来源:page.php
示例13: md5
$md = md5(gen_trivial_password() . $_POST['db_secret']);
$opt = " (";
$user = array(99999, $now, 0, 0, 0, "", "", "space", "space", 0, 0, $md, "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "0.0.0.0", 1, "", 1, 2, 0, 0, hostname() . "evolution/", 1, 1, 1, 3, 'en', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
foreach ($user as $i => $entry) {
if ($i != 0) {
$opt .= ", ";
}
$opt .= "'" . $user[$i] . "'";
}
$opt .= ")";
$query = "INSERT INTO " . $_POST["db_prefix"] . "users VALUES" . $opt;
dbquery($query);
// Создать администраторский аккаунт (Legor).
$md = md5($_POST['admin_pass'] . $_POST['db_secret']);
$opt = " (";
$user = array(1, $now, 0, 0, 0, "", "", "legor", "Legor", 0, 0, $md, "", $_POST['admin_email'], $_POST['admin_email'], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "0.0.0.0", 1, "", 1, 2, 0, 0, hostname() . "evolution/", 1, 1, 1, 3, 'en', 1, 1000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
foreach ($user as $i => $entry) {
if ($i != 0) {
$opt .= ", ";
}
$opt .= "'" . $user[$i] . "'";
}
$opt .= ")";
$query = "INSERT INTO " . $_POST["db_prefix"] . "users VALUES" . $opt;
dbquery($query);
// Создать планету Arrakis [1:1:2] и луну Mond.
$opt = " (";
$planet = array(1, "Arakis", 102, 1, 1, 2, 1, 12800, 40, 0, 163, $now, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 0, 1, 1, 1, 1, 1, 1, $now, $now, 0, 0);
foreach ($planet as $i => $entry) {
if ($i != 0) {
$opt .= ", ";
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:31,代码来源:install.php
示例14: SendCoupon
function SendCoupon($user, $code)
{
global $loca_lang;
$old_lang = $loca_lang;
// Сохранить язык пользователя, который инициировал событие рассылки
loca_add("coupons", $user['lang']);
// добавить языковые ключи пользователя, которому посылается сообщение и установить язык этого пользователя.
$loca_lang = $user['lang'];
mail_html($user['pemail'], loca("COUPON_SUBJ"), va(loca("COUPON_MESSAGE"), $user['oname'], $code), "From: coupon@" . hostname());
$loca_lang = $old_lang;
// Восстановить язык пользователя
}
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:12,代码来源:coupon.php
示例15: configure
/**
* Configure application constants
*
* @return Array an assoc array containing all the user-defined constants
*/
public static function configure()
{
require_once 'lib/Config.php';
// Load any local config settings before loading any generic settings
self::load(hostname());
self::load('app');
// Return an array with all the user-defined constants
return Config::get_constants();
}
开发者ID:hutchike,项目名称:YAWF,代码行数:14,代码来源:App.php
示例16: SendCoupon
function SendCoupon($user, $code)
{
global $GlobalUni;
loca_add("coupons", $GlobalUni['lang']);
// добавить языковые ключи пользователя, которому посылается сообщение.
mail_html($user['pemail'], loca("COUPON_SUBJ"), va(loca("COUPON_MESSAGE"), $user['oname'], $code), "From: coupon@" . hostname());
}
开发者ID:vksavochkin,项目名称:ogame-opensource,代码行数:7,代码来源:coupon.php
示例17: admin
function admin()
{
$qb = ses('qb');
$qda = ses('qda');
$qdu = ses('qdu');
$USE = ses('USE');
$auth = ses('auth');
$admin = $_GET['admin'] ? $_SESSION['admin'] = $_GET['admin'] : $_SESSION['admin'];
if ($_GET['set']) {
$_SESSION['set'] = $_GET['set'];
}
if ($USE != "") {
$hubname = rse("hub", $qdu . ' WHERE name="' . $qb . '"');
if (!$hubname) {
$hubname = $qb;
}
list($autologok, $userhub) = sql('name,hub', 'qdu', 'r', 'ip="' . hostname() . '"');
}
$rep = "params";
//verif_user
if ($USE != $qb && $USE != "" && $userhub) {
$hub = lka('/' . $USE, $USE);
} elseif ($USE != $qb && $USE != "" && $autologok != $USE && $autologok) {
$alert .= lkc('txtx', '/?log=on', 'autolog') . ' ';
} elseif ($USE == $qb && !$userhub && prmb(11) >= 4) {
$alert .= lkc("txtred", "/?log=create_hub", "create_hub!");
} elseif ($USE == "") {
$reta = lkc('txtx', htac('module') . 'Home', $qb) . br() . br() . loged($USE, $_SESSION['iq'], "", 7) . br();
}
//admin_menu
$aff = adminauthes();
if ($admin == "=") {
$_SESSION['set'] = $_GET['set'] = $USE ? "Global" : "User";
}
//defaults
if ($aff[$_GET['set']]) {
$admin = key($aff[$_GET['set']]);
}
$_SESSION['admin'] = $admin;
$goto = '/?admin=' . $admin;
//if(!$userhub){unset($aff['User']['mail']); unset($aff['User']['password']);}
//auto_select_category
foreach ($aff as $k => $v) {
if ($v[$admin]) {
$_SESSION['set'] = $k;
$curauth = $v[$admin];
}
$raf = array_merge_b($raf, array_keys($v));
}
if ($curauth === false) {
$curauth = 7;
}
//login
if ($USE) {
$w .= lkc('popw', htac('module') . 'Home', pictxt('home', $hubname)) . ' ';
$w .= btn("popbt", pictxt('user', $USE . ' ' . asciinb($auth)) . ' (' . nameofauthes($auth) . ')');
}
//fastmenu
$fmn = array('console', 'params', 'restrictions', 'apps', 'css', 'finder', 'templates', 'connectors', 'plugin', 'msql', 'tools', 'pictos', 'stats', 'update');
foreach ($raf as $v) {
if (in_array($v, $fmn)) {
$tit .= lkc(active($admin, $v), htac('admin') . $v, pictit(mimes_types($v), $v)) . ' ';
}
}
$reta .= divc('right', $w . $alert);
$tit .= lkc('txtit', htac('admin') . $admin, $admin) . ' ';
if ($admin != "=") {
$reta .= div('', $tit);
}
if ($auth >= 7 && $admin == 'update') {
$ret = adm_update();
}
if ($auth >= $curauth && $curauth) {
switch ($admin) {
//global
case 'console':
$ret = adm_console($auth);
break;
case 'apps':
require_once 'adminx.php';
$ret = adm_apps($_GET['set'], '', $_GET['dig']);
break;
case 'messages':
if ($qb == $USE or $auth >= $curauth) {
$ret = adm_messages();
} else {
$ret = contact(nms(84), 'txtcadr');
}
break;
case 'hubs':
$ret = adm_hubs($auth);
break;
case 'nodes':
$ret = adm_nodes($auth, $goto);
break;
case 'stats':
list($p, $o) = explode('/', $_GET['set']);
$ret = plugin('stats', $p, $o);
break;
case 'newsletter':
//.........这里部分代码省略.........
开发者ID:philum,项目名称:cms,代码行数:101,代码来源:admin.php
示例18: ob_end_flush
ob_end_flush();
exit;
}
// Обработка POST-запросов.
if (method() === "POST") {
if ($_POST['aktion'] === "Переименовать") {
RenamePlanet($GlobalUser['aktplanet'], $_POST['newname']);
$aktplanet = GetPlanet($GlobalUser['aktplanet']);
} else {
if ($_POST['aktion'] === "Покинуть колонию") {
PlanetDestroyMenu();
} else {
if ($_POST['aktion'] === "Удалить планету!") {
// Проверить пароль.
if (CheckPassword($GlobalUser['name'], $_POST['pw']) == 0) {
$RenameError = "<center>\n" . "Пароль неверный.<BR><BR> Если Вы забыли пароль, нажмите <A HREF=reg/mail.php>сюда</A> <BR><BR> или попробуйте <a\n" . "href=" . hostname() . " target='_top'> ещё раз</a> .<br></center>\n\n";
} else {
// Проверить принадлежит планета этому пользователю.
$planet = GetPlanet(intval($_POST['deleteid']));
if ($planet['owner_id'] == $GlobalUser['player_id']) {
// Главную планету нельзя удалить.
if (intval($_POST['deleteid']) == $GlobalUser['hplanetid']) {
$RenameError = "<center>\nНельзя покинуть главную планету!<br></center>\n";
} else {
$query = "SELECT * FROM " . $db_prefix . "fleet WHERE target_planet = " . intval($_POST['deleteid']) . " AND owner_id = " . $GlobalUser['player_id'];
$result = dbquery($query);
if (dbrows($result) > 0) {
$RenameError = "<center>\nВаши флоты ещё на пути к этой планете!<br></center>\n";
}
if ($RenameError === "") {
$query = "SELECT * FROM " . $db_prefix . "fleet WHERE start_planet = " . intval($_POST['deleteid']);
开发者ID:vksavochkin,项目名称:ogame-opensource,代码行数:31,代码来源:renameplanet.php
示例19: save_track
function save_track($msg, $id, $name, $mail)
{
$pdt = time();
$iq = hostname();
//ses('iq');
if (is_numeric($id) or substr($id, 0, 4) == 'wall') {
$local = true;
}
if (!$msg) {
return;
}
// btn('popdel','bruuu! '.helps('empty_msg'));
req('sav');
$qb = $_SESSION['qb'];
$base = $_SESSION['qdi'];
$_GET['idy'] = 'ok';
$_GET['insert'] = 'ok';
$_POST['name'] = $nm;
$_POST['msg'] = $msg;
if (!rstr(2) or auth(4)) {
$op = 1;
} else {
$op = 0;
}
$here = host() . '/?read=' . $id;
$msg = str_replace(":chat", "", $msg);
$msg = repair_latin($msg);
$msg = embed_links($msg);
//$amsg=mysql_real_escape_string(stripslashes($msg));
$values = array($ib, $name, $mail, $pdt, $qb, $id, $suj, $msg, $op, $ip);
//,'','',''
$nread = insert('qdi', mysqlra($values));
$suj = $local ? suj_of_id($id) : nms(84);
$nmsg = lka($here . '#trk' . $nread, $local ? helps('trackmail') : nms(84)) . br() . br();
$nmsg .= nms(68) . ': ' . $name . ', ' . mkday($pdt) . br() . br() . format_txt($msg, '', '');
$admail = $_SESSION['qbin']['adminmail'];
//to_admin
if ($name != $_SESSION['USE']) {
send_mail_html($admail, $suj, $nmsg, $mail, urlread($id));
}
if ($local) {
$rmails = sql('mail', 'qdi', 'k', 'frm="' . $id . '" AND re>="1"');
}
//deploy
$kem = sql('name', 'qda', 'v', 'id="' . $id . '"');
//send_to_author
if ($kem != $name) {
$kmail = sql('mail', 'qdu', 'v', 'name="' . $kem . '"');
if ($admail != $kmail) {
$rmails[$kmail] = 1;
}
}
//send_track_to_user
if ($rmails && $op == 1) {
send_mail_r(array_keys_b($rmails), 'html', $suj, $nmsg, $mail, $id);
}
if (!$local) {
return popup(nms(34), divc('', helps('formail')), '');
}
return tracks_read($nread, '', '');
}
开发者ID:philum,项目名称:cms,代码行数:61,代码来源:tracks.php
示例20: mail_send
function mail_send($id, $va, $res)
{
//if($_SESSION['auth']<3)return btn('txtred','bruuu must_be_loged');
$j = 'popup_plup__x_mail_plug*mail';
list($from, $to, $txt, $suj) = ajxr($res);
if (strpos($to, '@') !== false && $txt && $to && $from) {
send_mail('html', $to, $suj ? $suj : host(), divc('justy', $txt), $from ? $from : hostname(), '');
return lj('txtyl', $j, nms(79) . ' ' . nms(36) . ': ' . $to);
} else {
return lj('txtyl', $j, 'error');
}
}
开发者ID:philum,项目名称:cms,代码行数:12,代码来源:mail.php
注:本文中的hostname函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论