Ik heb een domeincheck.class.php
Deze code wordt hierin aangeroepen :
Het probleem is nu dat deze klasse alleen maar true uitpoept, het lijkt erop alsof die functie uberhaupt niet wordt uitgevoerd aangezien het binnen een seconde gebeurd is.
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
| class domeincheck { function domeincheck($dnames) { if(!isset($dnames) && $dnames!="") { if(stristr($dnames,"http://") || stristr($dnames,"www.")) { if(stristr($dnames,"http://")) { $dnames=str_replace("http://","",$dnames); } if(stristr($dnames,"www.")) { $dnames=str_replace("www.","",$dnames); } } while ($i < mb_strlen($dnames)) { $punt = mb_substr($dnames,$i,1); if ($punt == ".") { $ext = mb_substr($dnames,$i+1,mb_strlen($dnames)-$s); $dnames = mb_substr($dnames,0,$i); $punt=""; if(!preg_match('/^[a-z0-9]+$/i',$dnames)) { $IDNcheck=TRUE; $IDN = new idna_convert(); $idomain = $IDN->encode($dnames); $search="$idomain.$ext"; } if($ext=="com" || $ext=="net"||$ext=="org" || $ext=="COM" || $ext=="NET"||$ext=="ORG") { $NICserver="whois.internic.net"; if(stristr($domain, "xn--") && $IDNcheck=false){$search="$dnames.$ext";} elseif(preg_match('/^[a-z0-9]+$/i',$dnames) && $IDNcheck=false) {$search="$dnames.$ext";} } } $i=$i+1; } $socket = fsockopen("$NICserver", 43); if(!$socket) { echo "<font face='Arial' size='1'>failed to retreive $dnames.$ext , <B>$NICserver</B> probably doesn't exist.<BR>\n A possible cause is the inexistence of the extension <B>$ext</B> .<BR>\n Or the whois server is temporarily unavailable or overloaded.<BR>\n </font>"; }else { fputs($socket,"$search \n"); //echo "$search"; while(!feof($socket)) { $output .= fgetss($socket,128); } fclose($socket); if(stristr($output,"No match")) { return true; }else { return false; } } } } } |
Deze code wordt hierin aangeroepen :
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
| if(!empty($_POST) && $dnames!="" && isset($dnames)) { mb_internal_encoding("UTF-8"); $dnames =preg_replace('/\s\s+/',' ',$dnames); // de meervoudige spaties worden vervangen door enkelvoudige spaties $dnames=trim($dnames); $length=mb_strlen($dnames); $string=explode(" ",$dnames); $n=0; while($n<count($string)) { $check=new domeincheck(); $name=$string[$n]; $dcheck[$n]=$check->check($name); $n=$n+1; } //$wsearch=new domeincheck(); //the array is processed with the whois-search(for which a .class would be nifty) and the result is shown in a table $n=0; while($n<count($string)) { $name=$string[$n]; echo "<h3>"; if($dcheck[$n]=true){echo "$name is available";} else{echo "$name is reserved";} echo "</h3>"; $n=$n+1; } } |
Het probleem is nu dat deze klasse alleen maar true uitpoept, het lijkt erop alsof die functie uberhaupt niet wordt uitgevoerd aangezien het binnen een seconde gebeurd is.
[ Voor 35% gewijzigd door Verwijderd op 23-11-2005 18:58 ]