Most Referenced Functions
  » google_pagerank()
  » preg_replace()
  » imagecreatefrompng()
  » site_pageranks()
  » imagepng()
  » imagedestroy()
  » imagestring()
  » imagecolorallocate()
  » htmlentities()
  » fopen()
  » preg_match()
  » header()
  » getimagesize()
  » htmlspecialchars()
  » ob_start()
  » session_start()
  » strstr()
  » ob_flush()
  » preg_match_all()
  » strpos()
  » flush()
  » setcookie()
  » str_replace()
  » array2vars()
  » nl2br()
  » preg_split()
  » ereg()
  » urlencode()
  » ereg_replace()
  » readgzfile()

Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m.

PHP Functions

Function: tcpwrap_check

(PECL)

tcpwrap_check -- Performs a tcpwrap check

Description

bool tcpwrap_check ( string daemon, string address [, string user [, bool nodns]] )

This function consults the /etc/hosts.allow and /etc/hosts.deny files to check if access to service daemon should be granted or denied for a client.

Parameters

daemon

The service name.

address

The client remote address. Can be either an IP address or a domain name.

user

An optional user name.

nodns

If address looks like domain name then DNS is used to resolve it to IP address; set nodns to TRUE to avoid this.

Return Values

This function returns TRUE if access should be granted, FALSE otherwise.

Examples

Example 1. Deny all connections from localhost

If your /etc/hosts.deny file contains:

php: 127.0.0.1

And your code looks like:

<?php
if (!tcpwrap_check('php', $_SERVER['REMOTE_ADDR'])) {
  die('You are not welcome here');
}
?>

Related Function(s)

  • tidyNode_hasChildren()
  • tidyNode_hasSiblings()
  • tidyNode_isAsp()
  • tidyNode_isComment()
  • tidyNode_isHtml()
  • tidyNode_isJste()
  • tidyNode_isPhp()
  • tidyNode_isText()
  • ob_tidyhandler()
  • tidy_access_count()
  • tidy_clean_repair()
  • tidy_config_count()
  • tidy_construct()
  • tidy_diagnose()
  • tidy_error_count()
  • tidy_get_body()
  • tidy_get_config()
  • tidy_get_error_buffer()
  • tidy_get_head()
  • tidy_get_html_ver()
  • tidy_get_html()
  • tidy_get_opt_doc()
  • tidy_get_output()
  • tidy_get_release()
  • tidy_get_root()
  • tidy_get_status()
  • tidy_getopt()
  • tidy_is_xhtml()
  • tidy_is_xml()
  • tidy_load_config()
  • tidy_node_get_attr()
  • tidy_node_get_nodes()
  • tidy_node_next()
  • tidy_node_prev()
  • tidy_parse_file()
  • tidy_parse_string()
  • tidy_repair_file()
  • tidy_repair_string()
  • tidy_reset_config()
  • tidy_save_config()
  • tidy_set_encoding()
  • tidy_setopt()
  • tidy_warning_count()
  • Icemelon -- PHP, CSS, Javascript Tutorials, & More!
      © 2005-2010 Icemelon.com   Email: dave[AT]icemelon[D0T]c0m