|
Home
iRate! IceMelon IM Tutorials Headlines CoolSites PHP Functions |
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 checkDescriptionbool 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. addressThe client remote address. Can be either an IP address or a domain name. userAn optional user name. nodnsIf address looks like domain name then DNS is used to resolve it to IP address; set nodns to TRUE to avoid this. Return ValuesThis function returns TRUE if access should be granted, FALSE otherwise. ExamplesExample 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) |