🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #7225

gethostbynamel - php

#7225
From: Vincent Spruyt
Date: Thu, 10 Oct 2002 19:32
37 lines
2653 bytes
Op http://www.computersecurity.be/test/iplookup.php zie je het resultaat 
van volgende code:

if ($T1 == "") {
        $msg = "Geen host gespecifieerd.";
    } else {
         $ip = gethostbynamel ("$T1");
         if (sizeof($ip)>1) {
           $reply = "De IP adressen van <strong> $T1 </strong> zijn:";
         echo "<p><font face='Arial' size='2'>".$reply."</font></p>\n";
         for ($i = 0; $i < sizeof($ip); $i++) {
         echo "$ip[$i]<br>";
         }
         }
         else {
           $reply = "Het IP adres van <strong> $T1 </strong> is:";
           echo "<p><font face='Arial' size='2'>".$reply."</font></p>\n";
         for ($i = 0; $i < sizeof($ip); $i++) {
         echo "$ip[$i]<br>";
}
}
}        

Nu is er 1 probleem... Wanneer je als hostname bvb dsfsf.be of zelfs 
gewoon sdfsdfsrazrdf ingeeft, krijg je als ip het ip van de server waar 
computersecurity gehost staat... iemand een idee hoe ik dit kan tegen 
gaan. Een melding 'U moet een correcte hostname ingeven' zou natuurlijk 
wel mooier zijn...

ps. ik gebruik gethostbynamel ipv gethostbynamel om ook meerdere ip's te 
kunnen tonen... vraag bvb die van proxy.pandora.be eens op.

-- 
Computer games don't affect kids; I mean if Pac-Man affected us as kids, 
we'd all be running around in darkened rooms, munching magic pills and 
listening to repetitive electronic music. (Christian Wilson)
		- <url:http://www.computersecurity.be/> -
Technical Details
Message-ID: <Xns92B1DB4DFB783www.computersecurity@195.130.132.65>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.cwix.com!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,e77860c5038d3a0f,start
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2002-10-10 12:34:01 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.cwix.com!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
Newsgroups: be.comp.programming
Subject: gethostbynamel - php
From: Vincent Spruyt <info@computersecurity.be>
Organization: CSB
Message-ID: <Xns92B1DB4DFB783www.computersecurity@195.130.132.65>
User-Agent: Xnews/5.04.25
Keywords: www.computersecurity.be
X-Face: ndvatf(!8h`xUoD0bCL%?U!P0hU*scz_hkoe58x7_N]c`Y!K:!Wq'S29MK{TaDcYohc@+]A+XdehK/%zqyj:2,(\%z|S6=D7po"m*RF1.^q<jc&:)$SG}z5u=twOkoS"b=e$dPi>vi1sA^>V~i7K4R>gu]%"dz+hzWsywoYX)n)etQe\O!"!&bW(K'A5czax<$y9JIs:.F
Contact: info@computersecurity.be
Website: www.Computersecurity.be
Lines: 37
Date: Thu, 10 Oct 2002 19:32:32 GMT
NNTP-Posting-Host: 213.118.125.54
X-Complaints-To: abuse@telenet.be
X-Trace: afrodite.telenet-ops.be 1034278352 213.118.125.54 (Thu, 10 Oct 2002 21:32:32 MET DST)
NNTP-Posting-Date: Thu, 10 Oct 2002 21:32:32 MET DST