|
|
I'm sorry but you have definitely got your wires/posters crossed here
Murray.
The page that spentagesearching posted is http://www.webpal.ie/testwhois.php
and it still doesn't work.
The page that I put up in an effort to help the OP is at
http://www.westrayonline.co.uk/testwhois.php and still works (accepting
Doozas comments about domain types)
I say still because I have not altered the code since I originally uploaded
it.
Here it is again. A straight cut and copy from Dreamweavers code view.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Westray Online</title>
</head>
<body>
<p>This is the Westray Online website it is used primarily as a testing
server for Westray Digital Arts web design customers. </p>
<p>If you would like to know more about our web design and hosting services
please visit <a
href="http://www.westraywebdesign.co.uk">www.westraywebdesign.co.uk</a> </p>
<form name="form1" method="post" action="testwhois.php">
Domain: <input type="text" name="dom">
<input type="submit" name="Submit" value="Submit">
</form>
<?
if ($dom){
include "./whois.inc";
$whoisresult = lookup($dom);
$isavail = $whoisresult[0]; // Contains "1" is it's available, blank if
it's registered
$whotext = $whoisresult[1]; // Contains the full response from the server.
#The PRE tags are there to display the results in web browsers without
replacing \n with <br>..its just cleaner and quicker that way. ;)
if ($isavail=="1"){
print "<b>This domain is available!</b>";
}
else
{
print "<b>This domain has been registered.</b>";
}
print "<pre>".$whotext."</pre>";
}
?>
</body>
</html>
Now if there is a way for me to reveal that actual file from the server so
that you can believe me please let me know and I will do it.
Failing that, please be assured that this IS what is on my server and it
does work.
Phill
"Murray *ACE*" <forums@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:g6sodq$6sh$1@xxxxxxxxxxxxxxxxxxxxxxxx
> It must be magic. There's no way the code that has been posted could
> work. Let's analyze this a bit -
>
>> The fact that spentagesearching assures us that the code at
>> http://www.webpal.ie/testwhois.php is identical was why I questioned the
>> serve set up.
>
> I'm afraid he/she is simply mistaken. In my 5:23 post I suggested the
> correct code that should be used. I'm guessing that spentagessearching
> actually used that code on their site, which is why the page is now
> working. To show you that this MUST be the case, here is the code as you
> posted it (AND as shown on the ringsworld link) -
>
> http://www.murraytestsite.com/whois.php
>
> Note that the server throws an undefined variable error referring to the
> $dom variable, exactly as I said would be the case. This means that the
> sample code on the ringsworld link is definitely incorrect. Note also that
> the page just does not work.
>
> Here is the page after I have made the suggested modifications (with a few
> more modifications) -
>
> http://www.murraytestsite.com/whois2.php
>
> Note that this one does work after these modifications, although it, too,
> throws an error on completion. The ringsworld code is really very poor
> stuff. Here is the modified code -
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <title>phpGlobalWhois</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <form name="form1" method="post" action="whois2.php">
> Domain: <input type="text" name="dom" id="dom">
> <input type="submit" name="Submit" value="Submit">
> </form>
> <?
> //$dom = '';
> if (isset($_POST['Submit']) && $_POST['Submit'] == 'Submit') {
> $dom = $_POST['dom'];
> if ($dom){
>
> // Note that I am including the whois markup directly in the page for
> clarity
>
> function get_whois_info($domain){
> $whoisservers=array(
> ...snipped out the voluminous array of whois servers...
> );
> $whocnt = count($whoisservers);
> for ($x=0;$x<$whocnt;$x++){
> $artld = $whoisservers[$x][0];
> $tldlen = intval(0 - strlen($artld));
> if (substr($domain, $tldlen) == $artld) {
> $out[0] = $whoisservers[$x][1];
> $out[1] = $whoisservers[$x][2];
> return $out;
> }
> }
> return $out;
> }
>
> function lookup($dom){
> $whoinf = get_whois_info($dom);
> $lusrv = $whoinf[0];
> $notfndtxt = $whoinf[1];
>
> if (!$lusrv) return "";
>
> $fp = fsockopen($lusrv, 43);
> fputs($fp, "$dom\r\n");
> $string="";
> while(!feof($fp)){
> $string.= fgets($fp, 128);
> }
> fclose($fp);
>
> $reg = "/Whois Server: (.*?)\n/i";
> preg_match_all($reg, $string, $matches);
> $secondtry = $matches[1][0];
>
> if ($secondtry){
> $fp = fsockopen($secondtry, 43);
> fputs($fp, "$dom\r\n");
> $string="";
> while(!feof($fp)){
> $string.=fgets($fp, 128);
> }
> fclose($fp);
> }
> if (stristr($string, $notfndtxt)) $data[0] = "1";
> $data[1] = $string;
> return $data;
> }
> $whoisresult = lookup($dom);
> $isavail = $whoisresult[0]; // Contains "1" is it's available, blank
> if it's registered
> $whotext = $whoisresult[1]; // Contains the full response from the
> server.
> //The PRE tags are there to display the results in web browsers
> without replacing \n with <br>..its just cleaner and quicker that way.
> if ($isavail=="1"){
> print "<b>This domain is available!</b>";
> }
> else
> {
> print "<b>This domain has been registered.</b>";
> }
> print "<pre>".$whotext."</pre>";
> }
> }
> ?>
> </body>
> </html>
>
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> ==================
>
>
> "Phill Hellewell (pmsoftware)" <phill@xxxxxxxxxxxxxxxx> wrote in message
> news:g6skas$2e5$1@xxxxxxxxxxxxxxxxxxxxxxxx
>> "Murray *ACE*" <forums@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:g6sh1i$s4o$1@xxxxxxxxxxxxxxxxxxxxxxxx
>>> It's not possible for that code to 'work'. There is nothing that is ...
>>
>> What can I say. It does!
>>
>> The code I gave in the previous post is a straight cut n paste from the
>> Dreamweaver Code view.
>>
>> You can follow the link to http://www.westrayonline.co.uk/testwhois.php
>> and try it your self.
>>
>> It works.
>>
>> The fact that spentagesearching assures us that the code at
>> http://www.webpal.ie/testwhois.php is identical was why I questioned the
>> serve set up.
>>
>> Phill
>>
>
|
|