本文整理汇总了PHP中Host::ip2ulong方法的典型用法代码示例。如果您正苦于以下问题:PHP Host::ip2ulong方法的具体用法?PHP Host::ip2ulong怎么用?PHP Host::ip2ulong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host::ip2ulong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GET
<body>
<?php
if (!(GET('withoutmenu') == 1 || POST('withoutmenu') == 1)) {
include "../hmenu.php";
}
$ip = "";
$community = "";
$descr = "";
$ip = GET('ip') != "" ? GET('ip') : POST('ip');
ossim_valid($ip, OSS_IP_ADDR, OSS_NULLABLE, 'illegal:' . _("ip"));
if (ossim_error()) {
die(ossim_error());
}
if (GET('ip') != "") {
$devices = Device::get_list($conn, "where ip='" . Host::ip2ulong(GET('ip')) . "'");
foreach ($devices as $device) {
$community = $device->get_community();
$descr = $device->get_descr();
}
} else {
$community = POST('community');
ossim_valid($community, OSS_ALPHA, OSS_SPACE, OSS_SCORE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("name"));
$descr = POST('descr');
ossim_valid($descr, OSS_ALPHA, OSS_NULLABLE, OSS_SPACE, OSS_PUNC, OSS_AT, 'illegal:' . _("Description"));
if (ossim_error()) {
die(ossim_error());
}
}
if ($community != "" && GET('ip') == "") {
// only with POST
示例2: count
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
****************************************************************************/
require_once 'classes/Host.inc';
require_once 'classes/Util.inc';
if ($host != 'any') {
$host_ip2ulong = Host::ip2ulong($host);
if ($date_from != '' && $date_to != '') {
$date_from = preg_match("/^\\d+\\-\\d+\\-\\d+\$/", $date_from) ? $date_from . " 00:00:00" : $date_from;
$date_to = preg_match("/^\\d+\\-\\d+\\-\\d+\$/", $date_to) ? $date_to . " 23:59:59" : $date_to;
$tzc = Util::get_tzc();
$date_filter = "AND (convert_tz(date,'+00:00','{$tzc}') BETWEEN '{$date_from}' AND '{$date_to}')";
}
$where = "AND status='open' {$date_filter} ORDER BY date DESC";
$incident_list2 = Incident::get_list_filtered($conn, $host_ip2ulong, $where);
$tick_num = count($incident_list2);
} else {
$where = "AND status='open' ORDER BY date DESC";
$incident_list2 = Incident::search($conn, array("status" => "Open"), "priority", "DESC", 1, 6);
$tick_num = count($incident_list2);
}
$i_date = "-";