i got the echo of "AOHell user" to appear with this...
i'd look at what remote addr returns and check and see if that works with
your regexp.......

jack

$hostname = "www.aol.com";

    if (eregi(".*\.aol\.com.*", $hostname))
    {
        echo $hostname;
        echo "AOHell user";
    }
    else
    {
        echo $hostname;
        echo "Not on AOHell";
    }

-----Original Message-----
From: Alec Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 9:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problems with pattern matching


I'm attempting to get something like the following to match anything from
aol.com so that I can handle AOL users differently than users from other
ISPs:

    $hostname = gethostbyaddr($REMOTE_ADDR);

    if (eregi(".*\.aol\.com.*", $hostname))
    {
        echo $hostname;
        echo "AOHell user";
    }
    else
    {
        echo $hostname;
        echo "Not on AOHell";
    }

However, the else condition is always the one which is always executed. Any
ideas why? I'll admit to being somewhat weak when it comes to regular
expressions.

Thanks,
Alec


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to