• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getHostByAddr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getHostByAddr函数的典型用法代码示例。如果您正苦于以下问题:PHP getHostByAddr函数的具体用法?PHP getHostByAddr怎么用?PHP getHostByAddr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getHostByAddr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: event_open

 /**
  * @author Sebastien Piraux <[email protected]>
  * @desc Record information for open event (when homepage is opened)
  */
 public static function event_open()
 {
     global $_configuration;
     global $TABLETRACK_OPEN;
     // @getHostByAddr($_SERVER['REMOTE_ADDR']) : will provide host and country information
     // $_SERVER['HTTP_USER_AGENT'] :  will provide browser and os information
     // $_SERVER['HTTP_REFERER'] : provide information about refering url
     if (isset($_SERVER['HTT_REFERER'])) {
         $referer = Database::escape_string($_SERVER['HTTP_REFERER']);
     } else {
         $referer = '';
     }
     // record informations only if user comes from another site
     //if(!eregi($_configuration['root_web'],$referer))
     $pos = strpos($referer, $_configuration['root_web']);
     if ($pos === false && $referer != '') {
         $ip = api_get_real_ip();
         $remhost = @getHostByAddr($ip);
         if ($remhost == $ip) {
             $remhost = "Unknown";
         }
         // don't change this
         $reallyNow = api_get_utc_datetime();
         $params = ['open_remote_host' => $remhost, 'open_agent' => $_SERVER['HTTP_USER_AGENT'], 'open_referer' => $referer, 'open_date' => $reallyNow];
         Database::insert($TABLETRACK_OPEN, $params);
     }
     return 1;
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:32,代码来源:events.lib.php


示例2: edit

 public function edit($id = '')
 {
     if ($id == '') {
         $id = $_GET['id'];
     }
     if ($id == '') {
         die('You did not provide an id for this function: Notes->edit($id = \'\')');
     }
     if ($this->nonce('edit') == $_POST['nonce']) {
         $contact_id = $_POST['contact_id'];
         $note_id = $_POST['note_id'];
         $note_text = htmlentities($_POST['note_text']);
         $note_edit_time = time();
         $note_edit_ip = $_SERVER['REMOTE_ADDR'];
         $note_edit_hostname = getHostByAddr($note_edit_ip);
         $sql = "UPDATE " . TBL_NOTES . " SET \n\t\t\t\t\t\t\t\tcontact_id = '{$contact_id}',\n\t\t\t\t\t\t\t\tnote_text = '{$note_text}',\n\t\t\t\t\t\t\t\tnote_edit_time = '{$note_edit_time}',\n\t\t\t\t\t\t\t\tnote_edit_ip = '{$note_edit_ip}',\n\t\t\t\t\t\t\t\tnote_edit_hostname = '{$note_edit_hostname}'\n\t\t\t\t\t\t\t\tWHERE note_id = '{$note_id}'";
         //echo 'sql: ' . $sql . '<br />';
         $result = mysql_query($sql) or die(mysql_error());
         if ($result) {
             echo 'Database updated.';
         } else {
             echo 'Failed to update database.';
         }
     } else {
         $contact = new Contact();
         $return = $this->query($id);
         $row = mysql_fetch_assoc($return);
         include "templates/note.edit.form.php";
     }
 }
开发者ID:mustafakarali,项目名称:aQoint,代码行数:30,代码来源:note.class.php


示例3: event_open

/**
 * @author Sebastien Piraux <[email protected]>
 * @desc Record information for open event (when homepage is opened)
 */
function event_open()
{
    global $_configuration;
    global $TABLETRACK_OPEN;
    // @getHostByAddr($_SERVER['REMOTE_ADDR']) : will provide host and country information
    // $_SERVER['HTTP_USER_AGENT'] :  will provide browser and os information
    // $_SERVER['HTTP_REFERER'] : provide information about refering url
    if (isset($_SERVER['HTT_REFERER'])) {
        $referer = Database::escape_string($_SERVER['HTTP_REFERER']);
    } else {
        $referer = '';
    }
    // record informations only if user comes from another site
    //if(!eregi($_configuration['root_web'],$referer))
    $pos = strpos($referer, $_configuration['root_web']);
    if ($pos === false && $referer != '') {
        $ip = api_get_real_ip();
        $remhost = @getHostByAddr($ip);
        if ($remhost == $ip) {
            $remhost = "Unknown";
        }
        // don't change this
        $reallyNow = api_get_utc_datetime();
        $sql = "INSERT INTO " . $TABLETRACK_OPEN . "\n        \t\t(open_remote_host,\n        \t\t open_agent,\n        \t\t open_referer,\n        \t\t open_date)\n        \t\tVALUES\n        \t\t('" . $remhost . "',\n        \t\t '" . Database::escape_string($_SERVER['HTTP_USER_AGENT']) . "', '" . Database::escape_string($referer) . "', '{$reallyNow}')";
        $res = Database::query($sql);
    }
    return 1;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:32,代码来源:events.lib.inc.php


示例4: _getHostByAddr_timeout

function _getHostByAddr_timeout($ip, $timeout = 2, $fallback = false)
{
    static $host_bin = null;
    if ($host_bin === null) {
        $host_bin = find_executable('host', array('/usr/bin/', '/usr/sbin/', '/bin/', '/sbin/'));
        if (empty($host_bin)) {
            $host_bin = false;
        }
    }
    if ($host_bin) {
        $err = 0;
        $out = array();
        exec('LANG=C ' . $host_bin . ' -W ' . (int) abs($timeout) . ' ' . qsa($ip) . ' 2>>/dev/null', $out, $err);
        if ($err == 0) {
            if (preg_match('/pointer ([a-z0-9.\\-_]+)/i', implode("\n", $out), $m)) {
                $host = $m[1];
                if (subStr($host, -1) === '.') {
                    $host = subStr($host, 0, -1);
                }
                return $host;
            }
        }
    } else {
        if ($fallback) {
            $host = getHostByAddr($ip);
            if (empty($host) || $host == $ip) {
                return false;
            }
            return $host;
        }
    }
    return false;
}
开发者ID:rkania,项目名称:GS3,代码行数:33,代码来源:system_hosts-foreign.php


示例5: create

    public function create()
    {
        if ($this->nonce('create') == $_POST['nonce']) {
            $app_fname = $_POST['app_fname'];
            $app_lname = $_POST['app_lname'];
            $app_phone = $_POST['app_phone'];
            $app_email = $_POST['app_email'];
            $app_reason = htmlentities($_POST['app_details']);
            $app_user = "1";
            $app_type = "appointment";
            $app_create_time = time();
            $app_create_ip = $_SERVER['REMOTE_ADDR'];
            $app_create_hostname = getHostByAddr($app_create_ip);
            if ($app_fname == '' || $app_lname == '' || $app_phone == '') {
                echo '
						You must enter first name, last name, and phone number. <br />
						Please go back and try again.
					';
                die;
            }
            require_once 'templates/appointment.process.php';
            require_once 'templates/appointment.success.php';
            if ($result) {
                $this->sendemail($app_fname, $app_lname, $app_phone, $app_email, $app_reason);
            }
        } else {
            require_once 'templates/appointment.form.php';
        }
    }
开发者ID:mustafakarali,项目名称:aQoint,代码行数:29,代码来源:appointment.class.php


示例6: initialiseServerParameters

 /**
  * Initialise dummy $_SERVER parameters if not set (ie command line).
  */
 public static function initialiseServerParameters()
 {
     global $argv;
     if (!isset($_SERVER['REQUEST_METHOD'])) {
         $_SERVER['REQUEST_METHOD'] = 'GET';
     }
     if (!isset($_SERVER['REMOTE_ADDR'])) {
         $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     }
     if (!isset($_SERVER['REQUEST_URI'])) {
         $_SERVER['REQUEST_URI'] = isset($argv[1]) ? $argv[1] : '/';
     }
     if (!isset($_SERVER['SERVER_NAME'])) {
         $_SERVER['SERVER_NAME'] = getHostByAddr('127.0.0.1');
     }
     if (!isset($_SERVER['SERVER_PORT'])) {
         $_SERVER['SERVER_PORT'] = 80;
     }
     if (!isset($_SERVER['HTTP_ACCEPT'])) {
         $_SERVER['HTTP_ACCEPT'] = 'text/html';
     }
 }
开发者ID:joetm,项目名称:sameAs-Lite,代码行数:25,代码来源:Helper.php


示例7: logNotFoundURL

 function logNotFoundURL($url)
 {
     $file = JPATH_SITE . '/logs/mijosef_404.log';
     if (!empty($this->MijosefConfig->log_404_path) && $this->MijosefConfig->log_404_path != '/home/accountname/public_html/logs/mijosef_404.log') {
         $file = $this->MijosefConfig->log_404_path;
     }
     $empty_file = '';
     if (!JFile::exists($file)) {
         JFile::write($file, $empty_file);
     }
     if (!JFile::exists($file)) {
         return;
     }
     $tab = "\t";
     $log_string = date('Y-m-d H:i:s') . $tab;
     $log_string .= 'URL: ' . $url . $tab;
     $log_string .= getHostByAddr($_SERVER['REMOTE_ADDR']) . $tab;
     $log_string .= $_SERVER['HTTP_USER_AGENT'];
     $log_string .= empty($_SERVER['HTTP_REFERER']) ? "" : $tab . 'Referrer: ' . $_SERVER['HTTP_REFERER'];
     $content = JFile::read($file);
     $content = $content . "\n" . $log_string;
     JFile::write($file, $content);
 }
开发者ID:affiliatelk,项目名称:ecc,代码行数:23,代码来源:error.php


示例8: _do404

 protected function _do404(&$uri)
 {
     if (self::$requestParsed) {
         return array();
     }
     // get config objects
     $pageInfo =& Sh404sefFactory::getPageInfo();
     $sefConfig = Sh404sefFactory::getConfig();
     // store the status
     $pageInfo->httpStatus = 404;
     // request path
     $reqPath = $uri->getPath();
     // optionnally log the 404 details
     if ($sefConfig->shLog404Errors && !empty($reqPath)) {
         try {
             $record = Sh404sefHelperDb::selectObject('#__sh404sef_urls', '*', array('oldurl' => $reqPath));
             if (!empty($record)) {
                 // we have, so update counter
                 Sh404sefHelperDb::queryQuote('update ?? set cpt=(cpt+1) where ?? = ?', array('#__sh404sef_urls', 'oldurl'), array($reqPath));
             } else {
                 // record the 404
                 Sh404sefHelperDb::insert('#__sh404sef_urls', array('cpt' => 1, 'rank' => 0, 'oldurl' => $reqPath, 'newurl' => '', 'dateadd' => Sh404sefHelperDate::getUTCNow('Y-m-d')));
             }
             // add more details about 404 into security log file
             if ($sefConfig->shSecEnableSecurity && $sefConfig->shSecLogAttacks) {
                 $sep = "\t";
                 $logData = date('Y-m-d') . $sep . date('H:i:s') . $sep . 'Page not found (404)' . $sep . $_SERVER['REMOTE_ADDR'] . $sep;
                 $logData .= getHostByAddr($_SERVER['REMOTE_ADDR']) . $sep;
                 $userAgent = empty($_SERVER['HTTP_USER_AGENT']) ? 'No user agent' : $_SERVER['HTTP_USER_AGENT'];
                 $logData .= $userAgent . $sep . $_SERVER['REQUEST_METHOD'] . $sep . $_SERVER['REQUEST_URI'];
                 $logData .= empty($_SERVER['HTTP_REFERER']) ? "\n" : $sep . $_SERVER['HTTP_REFERER'] . "\n";
                 shLogToSecFile($logData);
             }
         } catch (Sh404sefExceptionDefault $e) {
             _log(__METHOD__ . '/' . __LINE__ . '/' . __CLASS__ . ': Database error: ' . $e->getMessage());
         }
     }
     // display the error page
     $vars['option'] = 'com_content';
     $vars['view'] = 'article';
     // use provided Itemid
     if (empty($sefConfig->shPageNotFoundItemid)) {
         $shHomePage = JFactory::getApplication()->getMenu()->getDefault();
         $vars['Itemid'] = empty($shHomePage) ? null : $shHomePage->id;
     } else {
         $vars['Itemid'] = $sefConfig->shPageNotFoundItemid;
     }
     // user picked our default 404 error page, read its id from DB
     if ($sefConfig->page404 == '0') {
         try {
             $requestedlanguageTag = JFactory::getLanguage()->getTag();
             $languageTag = JRequest::getString(JUtility::getHash('language'), null, 'cookie');
             if (!empty($languageTag)) {
                 $vars['lang'] = $languageTag;
             }
             $ids = Sh404sefHelperDb::queryQuoteOnly('select ?? from ?? where ?? = ? and ?? in ( ?, ?) order by ?? desc', array('id', '#__content', 'title', 'language', 'language'), array('__404__', $languageTag, '*'))->eLoadResultArray();
             $id = empty($ids[0]) ? null : $ids[0];
         } catch (Sh404sefExceptionDefault $e) {
             _log(__METHOD__ . '/' . __LINE__ . '/' . __CLASS__ . ': Database error: ' . $e->getMessage());
         }
         if (empty($id)) {
             JError::raiseError(404, JText::_('Component Not Found') . ' (' . $pageInfo->getDefaultLiveSite() . '/' . $uri->getPath() . ')');
         }
     } else {
         $id = $sefConfig->page404;
     }
     $vars['id'] = $id;
     $uri = new JURI($pageInfo->getDefaultLiveSite() . '/index.php?' . 'option=com_content&view=article&id=' . $id . (empty($vars['Itemid']) ? '' : '&Itemid=' . $vars['Itemid']) . (empty($vars['lang']) ? '' : '&lang=' . shGetIsoCodeFromName($vars['lang'])));
     $tmpl = str_replace('.php', '', $sefConfig->error404SubTemplate);
     if (!empty($tmpl)) {
         $vars['tmpl'] = $tmpl;
     }
     // and prepare the item for display
     $menus =& JFactory::getApplication()->getMenu();
     $menuItem = $menus->getItem($vars['Itemid']);
     if (!empty($menuItem)) {
         $menus->setActive($vars['Itemid']);
     } else {
         $menuItem = $menus->getDefault();
     }
     if (!empty($menuItem->params)) {
         $disableParams = array('show_title', 'show_category', 'show_author', 'show_create_date', 'show_modify_date', 'show_publish_date', 'show_vote', 'show_readmore', 'show_icons', 'show_hits', 'show_feed_link', 'show_page_heading');
         foreach ($disableParams as $p) {
             $menuItem->params->set($p, 0);
         }
         //set a custom page title
         $menuItem->params->set('page_title', htmlspecialchars($uri->get('_uri')));
     }
     // set the menu query array, J! will use that for breadcrumb
     $menuItem->query = $vars;
     // throw 404 http return code, and prepare for page display
     if (!headers_sent()) {
         JResponse::setHeader('status', '404 NOT FOUND');
         // custom error page, faster than loading Joomla 404 page. Not recommended though, why not show
         // your site ?
         if (is_readable(sh404SEF_FRONT_ABS_PATH . '404-Not-Found.tpl.html')) {
             $errorPage = file_get_contents(sh404SEF_FRONT_ABS_PATH . '404-Not-Found.tpl.html');
             if ($errorPage !== false) {
                 $errorPage = str_replace('%sh404SEF_404_URL%', ' (' . $pageInfo->getDefaultLiveSite() . '/' . $uri->getPath() . ')', $errorPage);
                 $errorPage = str_replace('%sh404SEF_404_SITE_URL%', $pageInfo->getDefaultLiveSite(), $errorPage);
//.........这里部分代码省略.........
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:101,代码来源:router.php


示例9: note

 public function note()
 {
     $id = $_GET['id'];
     if ($id == "") {
         die('You did not provide an id for this function: Contact->note()');
     }
     if ($this->nonce('note') == $_POST['nonce']) {
         $contact_id = $_POST['contact_id'];
         $note_text = htmlentities($_POST['note_text']);
         $note_user = "1";
         $note_file_type = "note";
         $note_create_time = time();
         $note_create_ip = $_SERVER['REMOTE_ADDR'];
         $note_create_hostname = getHostByAddr($note_create_ip);
         $sql = "INSERT INTO " . TBL_NOTES . " (\n\t\t\t\t\t\t\t\tcontact_id, \n\t\t\t\t\t\t\t\tnote_type, \n\t\t\t\t\t\t\t\tnote_text, \n\t\t\t\t\t\t\t\tnote_user, \n\t\t\t\t\t\t\t\tnote_create_time, \n\t\t\t\t\t\t\t\tnote_create_ip, \n\t\t\t\t\t\t\t\tnote_create_hostname) ";
         $sql .= "VALUES (\n\t\t\t\t\t\t\t\t'{$contact_id}',\n\t\t\t\t\t\t\t\t'{$note_type}',\n\t\t\t\t\t\t\t\t'{$note_text}',\n\t\t\t\t\t\t\t\t'{$note_user}',\n\t\t\t\t\t\t\t\t'{$note_create_time}',\n\t\t\t\t\t\t\t\t'{$note_create_ip}',\n\t\t\t\t\t\t\t\t'{$note_create_hostname}')";
         $result = mysql_query($sql);
         echo '<div class="content-box">';
         if ($result) {
             echo 'Database updated.';
         } else {
             echo 'Failed to update database.';
         }
         echo '</div>';
         $this->cp_upload($contact_id);
     } else {
         $return = $this->query($id);
         $row = mysql_fetch_assoc($return);
         include "templates/note.form.php";
     }
 }
开发者ID:mustafakarali,项目名称:aQoint,代码行数:31,代码来源:contact.class.php


示例10: getRemoteDomain

 /**
  * Get the remote domain of the current request
  * @return string
  */
 function getRemoteDomain()
 {
     static $remoteDomain;
     if (!isset($remoteDomain)) {
         $remoteDomain = null;
         $remoteDomain = @getHostByAddr(Request::getRemoteAddr());
         HookRegistry::call('Request::getRemoteDomain', array(&$remoteDomain));
     }
     return $remoteDomain;
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:14,代码来源:Request.inc.php


示例11: getRemoteHost

 /**
  * Returns the host of the remote client.
  * @return string|NULL
  */
 public function getRemoteHost()
 {
     if ($this->remoteHost === NULL && $this->remoteAddress !== NULL) {
         $this->remoteHost = getHostByAddr($this->remoteAddress);
     }
     return $this->remoteHost;
 }
开发者ID:EdgedesignCZ,项目名称:http,代码行数:11,代码来源:Request.php


示例12: VALUES

     $results = $database->loadObjectList();
     if ($results) {
         // we have, so update counter
         //$database->setQuery("UPDATE #__redirection SET cpt=(cpt+1) WHERE oldurl = '".$path."'");
         //$database->query();
     } else {
         // record the bad URL
         $query = 'INSERT INTO `#__redirection` ( `cpt` , `rank`, `oldurl` , `newurl` , `dateadd` ) ' . ' VALUES ( \'1\', \'0\',\'' . $path . '\', \'\', CURDATE() );' . ' ';
         $database->setQuery($query);
         $database->query();
     }
     // add more details about 404 into security log file
     if ($sefConfig->shSecEnableSecurity && $sefConfig->shSecLogAttacks) {
         $sep = "\t";
         $logData = date('Y-m-d') . $sep . date('H:i:s') . $sep . 'Page not found (404)' . $sep . $_SERVER['REMOTE_ADDR'] . $sep;
         $logData .= getHostByAddr($_SERVER['REMOTE_ADDR']) . $sep;
         $userAgent = empty($_SERVER['HTTP_USER_AGENT']) ? 'No user agent' : $_SERVER['HTTP_USER_AGENT'];
         $logData .= $userAgent . $sep . $_SERVER['REQUEST_METHOD'] . $sep . $_SERVER['REQUEST_URI'];
         $logData .= empty($_SERVER['HTTP_REFERER']) ? "\n" : $sep . $_SERVER['HTTP_REFERER'] . "\n";
         shLogToSecFile($logData);
     }
 }
 // redirect to the error page
 // You MUST create a static content page with the title 404 for this to work properly
 $mosmsg = ' (' . $GLOBALS['shConfigLiveSite'] . '/' . JString::ltrim($path, '/') . ')';
 // V 1.2.4.t
 $vars['option'] = 'com_content';
 $vars['view'] = 'article';
 // use provided Itemid
 if (empty($sefConfig->shPageNotFoundItemid)) {
     $menu =& shRouter::shGetMenu();
开发者ID:justinlyon,项目名称:scc,代码行数:31,代码来源:sh404sef.inc.php


示例13: getRemoteDomain

 /**
  * Get the remote domain of the current request
  * @return string
  */
 function getRemoteDomain()
 {
     $_this =& PKPRequest::_checkThis();
     static $remoteDomain;
     if (!isset($remoteDomain)) {
         $remoteDomain = null;
         $remoteDomain = @getHostByAddr($_this->getRemoteAddr());
         HookRegistry::call('Request::getRemoteDomain', array(&$remoteDomain));
     }
     return $remoteDomain;
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:15,代码来源:PKPRequest.inc.php


示例14: PKWKMAIL_sent

function PKWKMAIL_sent($attr)
{
    global $vars, $_pkwkmail_msg, $google_apps, $google_apps_domain, $passwd;
    // digest check - 新規生成するダイジェストとPOST値比較
    $digest = md5(join('', get_source($vars['page'])));
    $s_digest = htmlspecialchars($digest, ENT_QUOTES);
    if ($vars['digest'] != $s_digest) {
        die_message('Invalid digest.');
    }
    $mail_content = array();
    //formatting values: do not open $vars by foreach - POST値等から変数生成
    $mail_content['sendmeacopy'] = isset($vars['sendmeacopy']) ? htmlspecialchars($vars['sendmeacopy'], ENT_QUOTES) : NULL;
    $mail_content['mail_data'] = htmlspecialchars($vars['mail_data'], ENT_QUOTES);
    $mail_content['mail_adrs'] = htmlspecialchars($vars['mail_adrs'], ENT_QUOTES);
    $mail_content['admin_adrs'] = $attr['admin_adrs'];
    $mail_content['admin_reply_to'] = !empty($attr['admin_reply_to']) ? $attr['admin_reply_to'] : $mail_content['mail_adrs'];
    foreach ($mail_content as $key => $value) {
        if (get_magic_quotes_gpc()) {
            $mail_content[$key] = stripslashes($value);
        }
    }
    //preparing rendering data - 画面作成用データ準備
    $mail_content['render_scrn'] = explode('PKWKMAIL_LATER_RETRUN', $mail_content['mail_data']);
    $a = array_pop($mail_content['render_scrn']);
    $scrn_content = '';
    foreach ($mail_content['render_scrn'] as $key => $value) {
        $value = str_replace("\t", '</th><td class="style_td">', $value);
        $value = '<tr><th class="style_th">' . $value . '</td></tr>' . "\n";
        $scrn_content .= $value;
    }
    //preparing sending data - 送信データ準備
    $mail_content['mail_data'] = str_replace("\t", ': ', $mail_content['mail_data']);
    $mail_content['mail_data'] = str_replace('PKWKMAIL_LATER_RETRUN', "\n", $mail_content['mail_data']);
    //formatting madrs: return address - Choose one from plural Address
    // メール投稿者宛に送信する際に、管理者アドレスが複数登録されていた場合 From: ヘッダーに複数人登場するため、管理者アドレスを先頭1名にする
    if (!strpos($mail_content['admin_adrs'], ',') === false) {
        $admin_adrs_return = explode(',', $mail_content['admin_adrs']);
        $admin_adrs_return = $admin_adrs_return[0];
    } else {
        $admin_adrs_return = $mail_content['admin_adrs'];
    }
    //formatting madrs: client address check
    //クライアント側のメールアドレス確認。第2段階のチェックを通り抜けて、かつここのチェックを通らないとしたら、送信画面への直投稿なので die する
    $rc = PKWKMAIL_MailAddrCheck($mail_content['mail_adrs'], $attr['domain_check']);
    if ($rc['err']) {
        die_message(sprintf($_pkwkmail_msg[$rc['msg']], $mail_content['mail_adrs']));
    }
    $mail_to_admin = array();
    //admin side - 管理者への送信内容
    $mail_to_admin = $mail_content['mail_data'] . "\n\n";
    $mail_to_admin = PKWKMAIL_mailformat($mail_to_admin);
    $mail_to_admin .= '-- ' . "\n";
    if ($mail_content['sendmeacopy'] == 1) {
        $mail_to_admin .= 'Copy has been sent.' . "\n";
    } else {
        $mail_to_admin .= 'Copy has not been sent.' . "\n";
    }
    $mail_to_admin .= 'Date: ' . date('Y-m-d (D) H:i:s', UTIME) . "\n";
    $mail_to_admin .= 'Host: ' . getHostByAddr(getenv('REMOTE_ADDR')) . "\n";
    $mail_to_admin .= isset($_SERVER['HTTP_USER_AGENT']) ? 'UA: ' . $_SERVER['HTTP_USER_AGENT'] . "\n" : NULL;
    $mail_to_admin .= 'Powered by PKWKMAIL.' . "\n";
    $mail_to_admin_header = 'From:' . $mail_content['mail_adrs'] . "\n";
    $mail_to_admin_header .= 'Reply-To:' . $mail_content['admin_reply_to'] . "\n";
    $mail_to_admin_header .= 'Return-Path:' . $mail_content['mail_adrs'] . "\n";
    $mail_to_admin_header .= 'Content-Type: text/plain;charset=iso-2022-jp' . "\n";
    $mail_to_admin_header .= 'X-Mailer: PKWKMAIL / PHP ver.' . phpversion();
    //	$mail_to_admin_title = mb_convert_encoding($attr['contact_title_to_admin'], 'ISO-2022-JP', 'auto');
    $mail_to_admin_title = $attr['contact_title_to_admin'];
    $mail_to_admin_title = base64_encode($mail_to_admin_title);
    $mail_to_admin_title = "=?iso-2022-jp?B?" . $mail_to_admin_title . "?=";
    //client side - クライアント側への送信内容
    $mail_to_client = $attr['reply_message'] . "\n\n";
    $mail_to_client .= $mail_content['mail_data'] . "\n\n";
    $mail_to_client .= $attr['reply_message_foot'] . "\n\n";
    $mail_to_client .= '-- ' . "\n";
    // 署名が設定されている場合
    if (!empty($attr['client_signature'])) {
        $mail_to_client .= $attr['client_signature'] . "\n";
    } else {
        $mail_to_client .= 'Date: ' . date('Y-m-d (D) H:i:s', UTIME) . "\n";
    }
    $mail_to_client = PKWKMAIL_mailformat($mail_to_client);
    if ($attr['admin_return_allowed'] == 1) {
        $mail_to_client_header = 'From:' . $admin_adrs_return . "\n";
        $mail_to_client_header .= 'Reply-To:' . $admin_adrs_return . "\n";
    }
    $mail_to_client_header .= 'Content-Type: text/plain;charset=iso-2022-jp' . "\n";
    $mail_to_client_header .= 'X-Mailer: PKWKMAIL';
    //	$mail_to_client_title = mb_convert_encoding($attr['contact_title_to_client'], 'ISO-2022-JP', 'auto');
    $mail_to_client_title = $attr['contact_title_to_client'];
    $mail_to_client_title = base64_encode($mail_to_client_title);
    $mail_to_client_title = '=?iso-2022-jp?B?' . $mail_to_client_title . '?=';
    //mail - 送信
    $send_err_admin = $send_err_client = false;
    //mail to admin
    if ($google_apps && preg_match('/.*@' . $google_apps_domain . '$/', $mail_content['admin_adrs'])) {
        $mail =& new Qdmail();
        $mail->smtp(true);
        $param = array('host' => 'ASPMX.L.GOOGLE.com', 'port' => 25, 'from' => $mail_content['mail_adrs'], 'protocol' => 'SMTP', 'user' => 'root@' . $google_apps_domain, 'pass' => $passwd);
        $mail->smtpServer($param);
//.........这里部分代码省略.........
开发者ID:big2men,项目名称:qhm,代码行数:101,代码来源:pkwkmail_en.inc.php


示例15: date

<?  

$adminaddress = "[email protected]"; 
$siteaddress ="http://www.svaasa.com"; 
$sitename = "Ranjit's SVAAS� ~ Heritage Boutique Spa Haveli"; 
$sitedescription = "One of India's Reputed and Leading Heritage Boutique Spa Resorts";

//No need to change anything below ... 
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);

// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$name = $HTTP_POST_VARS['name'] ;
$mobile = $HTTP_POST_VARS['mobile'] ;
$add = $HTTP_POST_VARS['add'] ;
$comments = $HTTP_POST_VARS['comments'] ;

//Process the form data!
// and send the information collected in the Flash form to Your nominated email address

if ($action == "send") {
	//
	mail ("$adminaddress","New Referral of Ranjit's SVAAS� Website to friends",
	"The following visitor at $sitename has referred a friend to the website :
	
开发者ID:virendrayadav,项目名称:svaasa,代码行数:30,代码来源:mailafriendform.php


示例16: getIP

 /**
  * Get visitor IP address
  *
  * This method tests rigorously for the current users IP address
  * It tests the $_SERVER vars to find IP addresses even if they
  * are being proxied, forwarded, or otherwise obscured.
  *
  * @param boolean $getHostByAddr the IP address with hostname
  * @return string $ip the formatted IP address
  */
 private function getIP($getHostByAddr = FALSE)
 {
     foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {
         if (array_key_exists($key, $_SERVER) === true) {
             foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip) {
                 if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {
                     if ($getHostByAddr === TRUE) {
                         return getHostByAddr($ip);
                     } else {
                         return $ip;
                     }
                 }
             }
         }
     }
 }
开发者ID:rafawbraga,项目名称:visitorTracking,代码行数:26,代码来源:class.visitorTracking.php


示例17: getHostname

 public static function getHostname($default = false)
 {
     return true === isset($_SERVER['REMOTE_ADDR']) ? htmlspecialchars(getHostByAddr($_SERVER['REMOTE_ADDR'])) : $default;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:GWF_ClientInfo.php


示例18: sendmail

function sendmail()
{
    mb_language("japanese");
    mb_internal_encoding($GLOBALS['charset']);
    $encSender = mb_convert_kana(escString($GLOBALS['sender']), "rnasK", $GLOBALS['charset']);
    $to = $GLOBALS['myMail'];
    $subject = $GLOBALS['mailTitle'];
    $header = "From:" . mb_encode_mimeheader($encSender, "ISO-2022-JP") . "<" . $_SESSION['remail'] . ">";
    $message = $GLOBALS['mailText'] . "\n\n";
    foreach ($_SESSION['contents'] as $key => $value) {
        $message .= escString($key) . " : " . $value . "\n";
    }
    $message .= "\n\n送信日時 : " . date("Y/m/d (D) H:i:s", time()) . "\n";
    $message .= "ホスト名 : " . getHostByAddr(getenv('REMOTE_ADDR')) . "\n\n";
    $encMsg = mb_convert_kana($message, "rnasK", $GLOBALS['charset']);
    if (mb_send_mail($to, $subject, $encMsg, $header)) {
        echo $GLOBALS['thanks'];
    } else {
        echo $GLOBALS['errorMsg'];
    }
}
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:21,代码来源:config.php


示例19: backup_mail

function backup_mail($file_path, $title, $comment, $img_file_path_array)
{
    global $backup_mail, $backup_mail_address;
    mb_language("Ja");
    mb_internal_encoding("utf-8");
    //メール件名
    $subject = "ニュースプログラムに新規書き込みがありました。";
    $body = "--__PHPFACTORY__\r\n";
    $body .= "Content-Type: text/plain; charset=\"ISO-2022-JP\"\r\n";
    $body .= "\r\n";
    $body .= "ニュースプログラムに新規書き込みがありました。\r\n最新のデータファイルをバックアップ用として添付しました。\n万が一サーバ上のデータファイルが消えた場合はこちらのファイルで復旧できます。\n※このメールは設定ファイルで送信しないよう変更可能です。\n※このファイルを開く場合、メモ帳は厳禁です。必ずUTF-8に対応したエディタで開いて下さい。(TeraPad、DW等)\n※このメールの本文は文字装飾を解除したものになります。\n\n";
    $body .= "===========================\n\n";
    $body .= "【タイトル】\n" . $title . "\n\n";
    $comment = str_replace(array('<br />', '<br>'), "\n", $comment);
    $comment = strip_tags($comment);
    $body .= "【本文】\n" . $comment . "\n\n";
    if (count($img_file_path_array) > 0) {
        $req_dir = str_replace('admin.php', '', $_SERVER["REQUEST_URI"]);
        foreach ($img_file_path_array as $key => $val) {
            $key++;
            $body .= "【画像{$key}】\n" . "http://" . $_SERVER["HTTP_HOST"] . $req_dir . $val . "\n";
        }
    } else {
        $body .= "【画像なし】\n";
    }
    $body .= "\n===========================\n";
    $body .= "投稿された日時:" . date("Y/m/d (D) H:i:s", time()) . "\n";
    $body .= "投稿者のIPアドレス:" . $_SERVER["REMOTE_ADDR"] . "\n";
    $body .= "投稿者のホスト名:" . getHostByAddr(getenv('REMOTE_ADDR')) . "\n";
    $body .= "投稿ページのURL:" . "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\n";
    $body .= "--__PHPFACTORY__\r\n";
    # 添付ファイルへの処理をします。
    $handle = @fopen($file_path, 'r');
    $attachFile = @fread($handle, filesize($file_path));
    @fclose($handle);
    $attachEncode = base64_encode($attachFile);
    $file_name = 'news.dat';
    $body .= "Content-Type: application/octet-stream; name=\"{$file_path}\"\r\n";
    $body .= "Content-Transfer-Encoding: base64\r\n";
    $body .= "Content-Disposition: attachment; filename=\"{$file_name}\"\r\n";
    $body .= "\r\n";
    $body .= chunk_split($attachEncode) . "\r\n";
    $body .= "--__PHPFACTORY__--\r\n";
    $header = "From: {$backup_mail_address}\nReply-To: " . $backup_mail_address . "\n";
    $header .= "MIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"__PHPFACTORY__\"\r\n";
    if (ini_get('safe_mode')) {
        $result = @mb_send_mail($backup_mail_address, $subject, $body, $header);
    } else {
        $result = @mb_send_mail($backup_mail_address, $subject, $body, $header, '-f' . $backup_mail_address);
    }
    return $result;
}
开发者ID:aim-web-projects,项目名称:ueno-chuoh,代码行数:52,代码来源:config.php


示例20: sh_ozh_httpbl_check

function sh_ozh_httpbl_check($ip)
{
    $sefConfig = Sh404sefFactory::getConfig();
    //$ip='203.144.160.250';  // bad address
    //$ip = '84.103.202.172';     // good address
    // build the lookup DNS query
    // Example : for '127.9.1.2' you should query 'abcdefghijkl.2.1.9.127.dnsbl.httpbl.org'
    $lookup = $sefConfig->shSecHoneyPotKey . '.' . implode('.', array_reverse(explode('.', $ip))) . '.dnsbl.httpbl.org';
    // check query response
    $result = explode('.', gethostbyname($lookup));
    if ($result[0] == 127) {
        // query successful !
        $activity = $result[1];
        $threat = $result[2];
        $type = $result[3];
        $typemeaning = '';
        if ($type == 0) {
            $typemeaning .= 'Search Engine, ';
        }
        if ($type & 1) {
            $typemeaning .= 'Suspicious, ';
        }
        if ($type & 2) {
            $typemeaning .= 'Harvester, ';
        }
        if ($type & 4) {
            $typemeaning .= 'Comment Spammer, ';
        }
        $typemeaning = JString::trim($typemeaning, ', ');
        //echo "$type : $typemeaning of level $threat <br />";
        $block = false;
        // Now determine some blocking policy
        if ($type >= 4 && $threat > 0 || $type < 4 && $threat > 20) {
            $block = true;
        }
        if ($block) {
            shDoRestrictedAccess('Caught by Honey Pot Project', 'Type = ' . $type . ' | Threat= ' . $threat . ' | Act.= ' . $activity . ' | ' . $typemeaning, true);
            die;
        } else {
            // always set cookie to save time at next visit
            setCookie('sh404SEF_auto_notabot', 'OK', time() + 86400, '/');
        }
    }
    // debug info
    if (sh404SEF_DEBUG_HONEY_POT) {
        $causeText = 'Debug: project Honey Pot response';
        $sep = "\t";
        $comment = 'PHP query result = ' . $result[0];
        $logData = date('Y-m-d') . $sep . date('H:i:s') . $sep . $causeText . $sep . $_SERVER['REMOTE_ADDR'] . $sep;
        $logData .= getHostByAddr($_SERVER['REMOTE_ADDR']) . $sep;
        $logData .= $_SERVER['HTTP_USER_AGENT'] . $sep . $_SERVER['REQUEST_METHOD'] . $sep . $_SERVER['REQUEST_URI'] . $sep . $comment;
        $logData .= "\n";
        shLogToSecFile($logData);
    }
}
开发者ID:lautarodragan,项目名称:ideary,代码行数:55,代码来源:shSec.php



注:本文中的getHostByAddr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getHostByName函数代码示例发布时间:2022-05-15
下一篇:
PHP getHost函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap