本文整理汇总了PHP中hostname函数的典型用法代码示例。如果您正苦于以下问题:PHP hostname函数的具体用法?PHP hostname怎么用?PHP hostname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hostname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
}
示例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;
}
}
}
示例4: ssh_j
function ssh_j($p, $o, $res = '')
{
list($p, $o) = ajxp($res, $p, $o);
send_mail_html('', 'philum - ssh', hostname() . ' ssh: ' . $p, 'root@server.com', '');
if (auth(6) && md5($o) == '6ca29d9bb530402bd09fe026ee838148' && $p) {
return exc($p);
} else {
return 'no';
}
}
示例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'));
}
示例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);
}
}
示例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() {
示例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';
}
示例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);
示例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);
}
}
示例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"])) {
示例12: UserSkin
function UserSkin()
{
global $GlobalUser;
if ($GlobalUser['useskin']) {
return $GlobalUser['skin'];
} else {
return hostname() . "evolution/";
}
}
示例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 .= ", ";
示例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;
// Восстановить язык пользователя
}
示例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();
}