CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
blockin HOST Names

 



G_Man
stranger

Feb 10, 2002, 8:35 PM

Post #1 of 3 (997 views)
blockin HOST Names Can't Post

I am trying to stop people from joining if yhey do not have a .com .org or a .net sufx. ie.... xxx.xx-xxx.xx.com (ok) but xxx.xx-xxx.xx.jp (No) I was thinking you would use the $ENV{REMOTE_HOST} and a search for a pattern, but im not good at patterns yetPirate

Thank You


Coderifous
journeyman

Feb 11, 2002, 7:45 AM

Post #2 of 3 (990 views)
Re: [G_Man] blockin HOST Names [In reply to] Can't Post

It shouldn't be to hard to fit this in your code, but:

if ( $url_to_test !~ /\.(?:com|net|org)\s*$/){

...you're not allowed ....

}

else{

...you're allowed...

}

Hope this helps

--Jim


Paul
Enthusiast

Feb 11, 2002, 9:32 AM

Post #3 of 3 (984 views)
Re: [G_Man] blockin HOST Names [In reply to] Can't Post

Hi,


Code
unless ($ENV{REMOTE_HOST} =~ m,\.(com|net|org)$,) { 
some error
}


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives