Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : TCP Wrappers Functions : tcpwrap_check

tcpwrap_check

Performs a tcpwrap check (PECL tcpwrap:0.1-1.0)
bool tcpwrap_check ( string daemon, string address [, string user [, bool nodns]] )

Example 2531. 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');
}
?>

Change Language


Follow Navioo On Twitter
tcpwrap_check
eXTReMe Tracker