fout in domeincheck script
Nu zit er een fout in regel 74 en ik kan niet uitvidnen wat het is...
de fout:
Notice: Undefined variable: sOutput in C:\apache\Apache2\htdocs\test\index.php on line 74
Hieronder de code:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?
function whoislookup($sDomain)
{
$aDom = explode(".", $sDomain);
if(substr($sDomain, 0, 4) == 'www.' && count($aDom) >= 3)
{
$sDomain = substr($sDomain,4);
}
$sExt = strtolower($aDom[count($aDom) - 1]);
$aNic = array('ar','im','as','am','au','bt','bg','cl','cc','cg','bi','rw','zr','cr','cz','dk','ec','fo','gl','fr','de','ir', 'it','jo','my','mx','ni','nl','nu','pk','pl','ru','sg','sk','es','tw','th','to','tm','uk','ua','co','ch','li');
$aUS = array('com','net','org','info','biz');
$aRipe = array('il','gr','gg','je');
$aAPNic = array();
$aAUNic = array();
$aJPNic = array('jp');
if($sExt != "")
{
$iErrorLevel = 0;
if(in_array($sExt, $aNic))
{
$sServer = "whois.nic." . $sExt;
}
elseif(in_array($sExt, $aUS))
{
$sServer = "whois.networksolutions.com";
}
elseif(in_array($sExt, $aRipe))
{
$sServer = "whois.ripe.net";
}
elseif(in_array($sExt, $aAPNic))
{
$sServer = "whois.apnic.net";
}
elseif(in_array($sExt, $aAUNic))
{
$sServer = "whois.ausregistry.net.au";
}
elseif(in_array($sExt, $aJPNic))
{
$sServer = "whois.nic.ad.jp";
$sDomain = $sDomain . "/e";
}
elseif($sExt == "se")
{
$sServer = "whois.nic-se.se";
}
elseif($sExt == "lu")
{
$sServer = "whois.restena.lu";
}
else
{
$iErrorLevel = 2;
}
}
else
{
$iErrorLevel = 1;
}
if (!empty($sDomain) && $iErrorLevel == 0)
{
$fp = fsockopen("$sServer", 43, &$errno, &$errstr, 30);
if(!$fp)
{
$output = "$errstr ($errno)<br>\n";
}
else
{
fputs($fp,"$sDomain\n");
while(!feof($fp))
{
$sOutput = $sOutput . ereg_replace("\t", " ", fgets($fp,128)) . "<BR>\n";
}
fclose($fp);
}
}
elseif($iErrorLevel == 2)
{
$sOutput = "Error $sExt for domain $sDomain is not a recognised extension<br>\n";
}
return $sOutput;
}
?>
function whoislookup($sDomain)
{
$aDom = explode(".", $sDomain);
if(substr($sDomain, 0, 4) == 'www.' && count($aDom) >= 3)
{
$sDomain = substr($sDomain,4);
}
$sExt = strtolower($aDom[count($aDom) - 1]);
$aNic = array('ar','im','as','am','au','bt','bg','cl','cc','cg','bi','rw','zr','cr','cz','dk','ec','fo','gl','fr','de','ir', 'it','jo','my','mx','ni','nl','nu','pk','pl','ru','sg','sk','es','tw','th','to','tm','uk','ua','co','ch','li');
$aUS = array('com','net','org','info','biz');
$aRipe = array('il','gr','gg','je');
$aAPNic = array();
$aAUNic = array();
$aJPNic = array('jp');
if($sExt != "")
{
$iErrorLevel = 0;
if(in_array($sExt, $aNic))
{
$sServer = "whois.nic." . $sExt;
}
elseif(in_array($sExt, $aUS))
{
$sServer = "whois.networksolutions.com";
}
elseif(in_array($sExt, $aRipe))
{
$sServer = "whois.ripe.net";
}
elseif(in_array($sExt, $aAPNic))
{
$sServer = "whois.apnic.net";
}
elseif(in_array($sExt, $aAUNic))
{
$sServer = "whois.ausregistry.net.au";
}
elseif(in_array($sExt, $aJPNic))
{
$sServer = "whois.nic.ad.jp";
$sDomain = $sDomain . "/e";
}
elseif($sExt == "se")
{
$sServer = "whois.nic-se.se";
}
elseif($sExt == "lu")
{
$sServer = "whois.restena.lu";
}
else
{
$iErrorLevel = 2;
}
}
else
{
$iErrorLevel = 1;
}
if (!empty($sDomain) && $iErrorLevel == 0)
{
$fp = fsockopen("$sServer", 43, &$errno, &$errstr, 30);
if(!$fp)
{
$output = "$errstr ($errno)<br>\n";
}
else
{
fputs($fp,"$sDomain\n");
while(!feof($fp))
{
$sOutput = $sOutput . ereg_replace("\t", " ", fgets($fp,128)) . "<BR>\n";
}
fclose($fp);
}
}
elseif($iErrorLevel == 2)
{
$sOutput = "Error $sExt for domain $sDomain is not a recognised extension<br>\n";
}
return $sOutput;
}
?>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?
if(!isset($_POST['whois'])){
echo "
<form name=\"whois\" method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">
<table width=\"500\" border=\"0\">
<tr>
<td width=\"111\">Domeinnaam:</td>
<td width=\"379\"><input name=\"domain\" type=\"text\" id=\"domain\" size=\"50\"></td>
</tr>
<tr>
<td> </td>
<td><input name=\"whois\" type=\"submit\" id=\"whois\" value=\"Whois\"></td>
</tr>
</table>
</form>
";
}else{
$domain = $_POST['domain'];
echo whoislookup($domain);
}
?>
if(!isset($_POST['whois'])){
echo "
<form name=\"whois\" method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">
<table width=\"500\" border=\"0\">
<tr>
<td width=\"111\">Domeinnaam:</td>
<td width=\"379\"><input name=\"domain\" type=\"text\" id=\"domain\" size=\"50\"></td>
</tr>
<tr>
<td> </td>
<td><input name=\"whois\" type=\"submit\" id=\"whois\" value=\"Whois\"></td>
</tr>
</table>
</form>
";
}else{
$domain = $_POST['domain'];
echo whoislookup($domain);
}
?>
Gewijzigd op 09/05/2005 16:13:00 door Harry
kan je ook ff aangeven welk regel 76 is? vind het zo rottig tellen...
$sOutput = $sOutput . ereg_replace("\t", " ", fgets($fp,128)) . "<BR>\n";
$sOutput = $sOutput . ereg_replace("\t", " ", fgets($fp,128)) . "<BR>\n";
De variabele bestaat niet!
Komt het uit een formulier?
Code (php)
1
2
3
2
3
<?
$sOutput = $_POST['sOutput'] . ereg_replace("\t", " ", fgets($fp,128)) . "<BR>\n";
?>
$sOutput = $_POST['sOutput'] . ereg_replace("\t", " ", fgets($fp,128)) . "<BR>\n";
?>