Domeincheck probleempje
Ik krijg mijn domeinchecker niet meer werkend.
Graag zou ik willen dat na mijn domeincheck direct de beschikbaarheid word getoond.
Het script zou moeten werken omdat het elders wel werkt.
Bij mij geeft hij bij alles aan dat het domein bezet is
Het invoeren van het domein kan bijvoorbeeld op mijn index pagina:
Klik hier om naar toe te gaan
Alle hulp is welkom groeten, Stef
Ziet iemand wat ik fout doe? hier heb ik de code:
(whois.php)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<?php
/****** Aan te passen gegevens ***********/
$template = "domein.php"; //vul hier een template naam in
//deze page moet "<!--DOMAIN RESULTS-->" bevatten
$registerlink = "bestel.php"; //bestelpagina
$restrict = 0; //set to 0 if you don't want to restrict access
//set to 1 if you want to restrict access remember to
//change $REFERERS below to reflect your site.
$REFERERS = array('stefdev.nl');
error_reporting(0);
/************************ END CUSTOMISATIONS ************************************/
/************************ SERVER DEFINITIONS ************************************/
$serverdefs= array(
"com" => array("whois.crsnic.net","No match for"),
"net" => array("whois.crsnic.net","No match for"),
"eu" => array("whois.eu","FREE"),
"org" => array("whois.pir.org","NOT FOUND"),
"biz" => array("whois.nic.biz","Not found"),
"info" => array("whois.afilias.net","NOT FOUND"),
"de" => array("whois.nic.de","FREE"),
"in" => array("whois.inregistry.in","NOT FOUND"),
"nl" => array("whois.domain-registry.nl","not a registered domain"),
"name" => array("whois.nic.name","No match"),
"us" => array("whois.nic.us","Not Found:"),
"ws" => array("whois.nic.ws","No match for"),
"be" => array("whois.dns.be","FREE"),
"nu" => array("whois.nic.nu","NO MATCH for"),
"it" => array("whois.nic.it","No entries found"),
"nl" => array("whois.domain-registry.nl","is free"),
"pl" => array("whois.dns.pl","No information about"),
"tv" => array("whois.nic.tv","No match for"),
"co.uk" => array("whois.nic.uk","No match"),
"org.uk" => array("whois.nic.uk","No match"),
"me.uk" => array("whois.nic.uk","No match"),
"tk" => array("whois.dot.tk","not known"),
"cc" => array("whois.nic.cc","No match"),
"ac" => array("whois.nic.ac","No match for"),
"ru" => array("whois.ripn.net","No entries found"),
"ag" => array("whois.nic.ag","NOT FOUND"),
"am" => array("whois.nic.am","No information available"),
"bz" => array("mhpwhois1.verisign-grs.net","No match"),
"gs" => array("whois.adamsnames.tc","is not registered"),
"co.in" => array("whois.iisc.ernet.in","no entries found"),
"jp" => array("whois.nic.ad.jp","No match!!"),
"ms" => array("whois.adamsnames.tc","is not registered"),
"com.sg" => array("whois.nic.net.sg","NOMATCH"),
"sh" => array("whois.nic.sh","No match"),
"com.tw" => array("whois.twnic.net","No Records Found"),
"org.tw" => array("whois.twnic.net","No Records Found"),
"vg" => array("whois.adamsnames.tc","is not registered"),
"la" => array("whois.nic.la","NO MATCH"),
"tc" => array("whois.adamsnames.tc","is not registered"),
"fm" => array("cwhois1.completewhois.com","not known"),
);
/*********************** END SERVER DEFINITIONS *********************************/
if ($_SERVER['REQUEST_METHOD'] == 'GET'){
$domain = $_GET['domain'];
$ext = $_GET['ext'];
$option = $_GET['option'];
}else{
$domain = $_POST['domain'];
$ext = $_POST['ext'];
$option = $_POST['option'];
}
if($restrict ==1){
check_referer();
}
/************* Perform checks domain x-ters *************************************/
namecheck($domain);
/************* Check domain zone ************************************/
if ($serverdefs[$ext]){
$server = $serverdefs[$ext][0];
$nomatch = $serverdefs[$ext][1];
if($option=="check")
{
$layout = check_domain($domain,$ext);
print_results($layout);
}
if($option=="whois")
{
whois($domain,$ext);
}
}
elseif($ext == "co.za"){
if($option == "check"){
if(function_exists(curl_init)){
$layout = cozacurlcheck($domain);
}else{
$layout = cozacheck($domain);
}
print_results($layout);
}elseif($option=="whois"){
if(function_exists(curl_init)){
cozacurlwhois($domain);
}else{
cozawhois($domain);
}
}
}
elseif($ext == "all"){
$layout = "<tr>\n<td>\n<table width=\"100%\" border=\"0\" cellPadding=2 class=main>\n";
foreach($serverdefs as $ext => $servers)
{
$server = $servers[0];
$nomatch = $servers[1];
$available = check_domain($domain, $ext);
if ($available == 0)
{
$layout .= sprintf("<tr>\n<td>\n%s.%s</td>\n<td>\n<font class=main color=\"green\">\n<b>Vrij!</b>\n</font>\n</td>\n", $domain, $ext);
$layout .= sprintf("<td>\n<a class=main href=\"%s?domain=%s.%s\">registreer nu</a>\n</td>\n</tr>\n", $registerlink, $domain, $ext);
}
elseif ($available == 2)
{
$layout .= sprintf("<tr>\n<td>\n%s.%s</td>\n<td>\n<font color=\"grey\">\nUnknown</font>\n</td>\n", $domain, $ext);
$layout .= "<td>\nKan geen verbinding maken met de server.</td>\n</tr>\n";
}
else
{
$layout .= sprintf("\n<tr>\n<td>\n%s.%s</td>\n<td>\n<font class=main color=\"red\">bezet\n</font>\n</td>\n", $domain, $ext);
$layout .= sprintf("<td>\n<a class=main href=\"%s?domain=%s.%s\">verhuis nu</a>\n</td>\n</tr>\n", $registerlink, $domain, $ext);
}
}
$layout .= "</table>\n</td>\n</tr>\n";
$ext = " all supported domains";
print_results($layout);
}
/** <------------------------------------functions--------------------------------> **/
function check_domain($domain,$ext)
{
global $nomatch,$server;
$output="";
if(($sc = fsockopen($server,43))==false){return 2;}
fputs($sc,"$domain.$ext\n");
while(!feof($sc)){$output.=fgets($sc,128);}
fclose($sc);
//compare what has been returned by the server
if (eregi($nomatch,$output)){
return 0;
}else{
return 1;
}
}
/********* Function to return whois results ***********************************/
function whois($domain,$ext)
{ global $template,$server;
if(($sc = fsockopen($server,43))==false){
if(($sc = fsockopen($server,43))==false){
//echo"There is a temporary service disruption Please again try later";
$layout =2;
print_results($layout);
exit;
}
}
if($ext=="com"||$ext=="net"){
//
fputs($sc, "$domain.$ext\n");
while(!feof($sc)){
$temp = fgets($sc,128);
if(ereg("Whois Server:", $temp)) {
$server = str_replace("Whois Server: ", "", $temp);
$server = trim($server);
}
}
fclose($sc);
if(($sc = fsockopen($server,43))==false){
//echo"There is a temporary service disruption Please try later";
$layout =2;
print_results($layout);
exit;
}
}
$output="";
fputs($sc,"$domain.$ext\n");
while(!feof($sc)){$output.=fgets($sc,128);}
fclose($sc);
//print
print_whois($output);
}
/******* Function to print the results into your template ************************/
function print_results($layout)
{
global $template,$registerlink,$domain,$ext,$server;
if(!is_file($template)){
print"The template file into which to print the results either does not exist or is
not writeable<br>
please correct this if you are the webmaster of this site<br>
The script can not continue exiting......";
exit;
}
$template = file ($template);
$numtlines = count ($template); //Number of lines in the template
$line = 0;
while (! stristr ($template[$line], "<!--DOMAIN RESULTS-->") && $line < $numtlines) {
echo $template[$line];
$line++;
}
if($layout=="0"){
$line++;
print "<h3>Het domein: \"$domain.$ext\" is vrij!</h3><a href=\"$registerlink?domein=$domain.$ext\" >registreer nu!</a>";
}
elseif($layout=="1"){
$line++;
print "<h3>Het domein: \"$domain.$ext\" is reeds bezet.</h3><font class=main>Bent u de eigenaar van dit domein dan kunt u het naar ons <a href=\"$registerlink?domein=$domain.$ext\" >verhuizen.</a>";
}
elseif($layout=="2"){
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=main>\n";
print "<tr>\n<td>\n<b>\nResultaten voor \"$domain.$ext\"</b>\n<br>\n</td>\n</tr>\n";
print "<tr>\n<td>\n<b>Kan geen verbinding maken met de server $server</b>\n<br>\n</td>\n</tr>\n";
print "</table>\n";
}
else{
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=main>\n";
print "<tr>\n<td>\n<b>Resultaten voor \"$domain.$ext\"</b>\n<br>\n</td>\n</tr>\n";
print $layout;
print "</table>\n";
}
while ($line < $numtlines) {
echo $template[$line];
$line++;
}
}
/******* Function to print whois results *****************************************/
function print_whois($output){
global $template,$domain,$ext;
if(!is_file($template)){
print"The template file into which to print the results either does not exist
or is not writable<br>
please correct this if you are the webmaster of this site<br>
The script can not continue exiting......";
exit;
}
$template = file ($template);
$numtlines = count ($template);
$line = 0;
while (! stristr ($template[$line], "<!--DOMAIN RESULTS-->") && $line < $numtlines) {
echo $template[$line];
$line++;
}
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=font1l>\n";
print "<tr>\n<td>\n<b>\nDomain whois query information for \"$domain.$ext\"</b>\n</td>\n</tr>\n";
print "<tr>\n<td>\n<hr>\n</td>\n</tr>\n";
print "<tr>\n<td>\n";
$output= explode("\n",$output);
foreach ($output as $value){
print "$value<br>\n";
}
}
/****** This checks the name for invaild characters *******************************/
function namecheck($domain)
{
if($domain==""){$layout = "<tr>\n<td>\n<font color=\"red\">\nU moet een domeinnaam invullen om te controleren.</font>\n<br>\n";
print_results($layout);exit;}
if(strlen($domain)< 3){$layout = "<tr>\n<td>\n<font color=\"red\">\nDe domeinnaam $domain is te kort.</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
if(strlen($domain)>57){$layout = "<tr>\n<td>\n<font color=\"red\">\nDe domeinnaam $domain is te lang.</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
if(@ereg("^-|-$",$domain)){$layout = "<tr>\n<td>\n<font color=\"red\">\nDomeinnaam mag niet beginnen met een hyphen</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
if(!ereg("([a-z]|[A-Z]|[0-9]|-){".strlen($domain)."}",$domain))
{$layout = "<tr>\n<td>\n<font color=\"red\">\nDomeinnaam mag geen speciale tekens bevatten.</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
}
/********** function to return whois record via socket ***********************/
function cozawhois($domain){
$errno = 0;
$errostr = "";
$timeout = 30;
$fp = fsockopen("co.za",80,$errno,$errstr,$timeout);
if($fp){
socket_set_timeout($fp,$timeout);
$url = "GET /cgi-bin/whois.sh?Domain=$domain HTTP/1.0\r\n Host: co.za\r\n";
$url .= "Connection: Keep-Alive\r\n User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)\r\n";
$url .= "Referer: http://co.za/whois.shtml\r\n Accept: text/plain, text/html\r\n\r\n";
fputs($fp,$url);
$output = "";
while(!feof($fp)){
$output .= fgets($fp,128);
}
fclose($fp);
$temp_code = strip_tags($output);
$startp = strpos($temp_code,"The CO.ZA simple whois server");
$dis = substr($temp_code,$startp);
print_whois($dis);
}else{
$layout = "<tr>\n<td>\nThe script could not connect to the co.za whois server<br>";
$layout.= "<b>DEBUG INFO:</b><br><br>";
$layout.= "Error No: $errno<br>Error Description:<br>$errstr</td>\n</tr>\n";
print_results($layout);
exit;
}
}
/***<--------------------------------end functions------------------------------------>***/
/****** Aan te passen gegevens ***********/
$template = "domein.php"; //vul hier een template naam in
//deze page moet "<!--DOMAIN RESULTS-->" bevatten
$registerlink = "bestel.php"; //bestelpagina
$restrict = 0; //set to 0 if you don't want to restrict access
//set to 1 if you want to restrict access remember to
//change $REFERERS below to reflect your site.
$REFERERS = array('stefdev.nl');
error_reporting(0);
/************************ END CUSTOMISATIONS ************************************/
/************************ SERVER DEFINITIONS ************************************/
$serverdefs= array(
"com" => array("whois.crsnic.net","No match for"),
"net" => array("whois.crsnic.net","No match for"),
"eu" => array("whois.eu","FREE"),
"org" => array("whois.pir.org","NOT FOUND"),
"biz" => array("whois.nic.biz","Not found"),
"info" => array("whois.afilias.net","NOT FOUND"),
"de" => array("whois.nic.de","FREE"),
"in" => array("whois.inregistry.in","NOT FOUND"),
"nl" => array("whois.domain-registry.nl","not a registered domain"),
"name" => array("whois.nic.name","No match"),
"us" => array("whois.nic.us","Not Found:"),
"ws" => array("whois.nic.ws","No match for"),
"be" => array("whois.dns.be","FREE"),
"nu" => array("whois.nic.nu","NO MATCH for"),
"it" => array("whois.nic.it","No entries found"),
"nl" => array("whois.domain-registry.nl","is free"),
"pl" => array("whois.dns.pl","No information about"),
"tv" => array("whois.nic.tv","No match for"),
"co.uk" => array("whois.nic.uk","No match"),
"org.uk" => array("whois.nic.uk","No match"),
"me.uk" => array("whois.nic.uk","No match"),
"tk" => array("whois.dot.tk","not known"),
"cc" => array("whois.nic.cc","No match"),
"ac" => array("whois.nic.ac","No match for"),
"ru" => array("whois.ripn.net","No entries found"),
"ag" => array("whois.nic.ag","NOT FOUND"),
"am" => array("whois.nic.am","No information available"),
"bz" => array("mhpwhois1.verisign-grs.net","No match"),
"gs" => array("whois.adamsnames.tc","is not registered"),
"co.in" => array("whois.iisc.ernet.in","no entries found"),
"jp" => array("whois.nic.ad.jp","No match!!"),
"ms" => array("whois.adamsnames.tc","is not registered"),
"com.sg" => array("whois.nic.net.sg","NOMATCH"),
"sh" => array("whois.nic.sh","No match"),
"com.tw" => array("whois.twnic.net","No Records Found"),
"org.tw" => array("whois.twnic.net","No Records Found"),
"vg" => array("whois.adamsnames.tc","is not registered"),
"la" => array("whois.nic.la","NO MATCH"),
"tc" => array("whois.adamsnames.tc","is not registered"),
"fm" => array("cwhois1.completewhois.com","not known"),
);
/*********************** END SERVER DEFINITIONS *********************************/
if ($_SERVER['REQUEST_METHOD'] == 'GET'){
$domain = $_GET['domain'];
$ext = $_GET['ext'];
$option = $_GET['option'];
}else{
$domain = $_POST['domain'];
$ext = $_POST['ext'];
$option = $_POST['option'];
}
if($restrict ==1){
check_referer();
}
/************* Perform checks domain x-ters *************************************/
namecheck($domain);
/************* Check domain zone ************************************/
if ($serverdefs[$ext]){
$server = $serverdefs[$ext][0];
$nomatch = $serverdefs[$ext][1];
if($option=="check")
{
$layout = check_domain($domain,$ext);
print_results($layout);
}
if($option=="whois")
{
whois($domain,$ext);
}
}
elseif($ext == "co.za"){
if($option == "check"){
if(function_exists(curl_init)){
$layout = cozacurlcheck($domain);
}else{
$layout = cozacheck($domain);
}
print_results($layout);
}elseif($option=="whois"){
if(function_exists(curl_init)){
cozacurlwhois($domain);
}else{
cozawhois($domain);
}
}
}
elseif($ext == "all"){
$layout = "<tr>\n<td>\n<table width=\"100%\" border=\"0\" cellPadding=2 class=main>\n";
foreach($serverdefs as $ext => $servers)
{
$server = $servers[0];
$nomatch = $servers[1];
$available = check_domain($domain, $ext);
if ($available == 0)
{
$layout .= sprintf("<tr>\n<td>\n%s.%s</td>\n<td>\n<font class=main color=\"green\">\n<b>Vrij!</b>\n</font>\n</td>\n", $domain, $ext);
$layout .= sprintf("<td>\n<a class=main href=\"%s?domain=%s.%s\">registreer nu</a>\n</td>\n</tr>\n", $registerlink, $domain, $ext);
}
elseif ($available == 2)
{
$layout .= sprintf("<tr>\n<td>\n%s.%s</td>\n<td>\n<font color=\"grey\">\nUnknown</font>\n</td>\n", $domain, $ext);
$layout .= "<td>\nKan geen verbinding maken met de server.</td>\n</tr>\n";
}
else
{
$layout .= sprintf("\n<tr>\n<td>\n%s.%s</td>\n<td>\n<font class=main color=\"red\">bezet\n</font>\n</td>\n", $domain, $ext);
$layout .= sprintf("<td>\n<a class=main href=\"%s?domain=%s.%s\">verhuis nu</a>\n</td>\n</tr>\n", $registerlink, $domain, $ext);
}
}
$layout .= "</table>\n</td>\n</tr>\n";
$ext = " all supported domains";
print_results($layout);
}
/** <------------------------------------functions--------------------------------> **/
function check_domain($domain,$ext)
{
global $nomatch,$server;
$output="";
if(($sc = fsockopen($server,43))==false){return 2;}
fputs($sc,"$domain.$ext\n");
while(!feof($sc)){$output.=fgets($sc,128);}
fclose($sc);
//compare what has been returned by the server
if (eregi($nomatch,$output)){
return 0;
}else{
return 1;
}
}
/********* Function to return whois results ***********************************/
function whois($domain,$ext)
{ global $template,$server;
if(($sc = fsockopen($server,43))==false){
if(($sc = fsockopen($server,43))==false){
//echo"There is a temporary service disruption Please again try later";
$layout =2;
print_results($layout);
exit;
}
}
if($ext=="com"||$ext=="net"){
//
fputs($sc, "$domain.$ext\n");
while(!feof($sc)){
$temp = fgets($sc,128);
if(ereg("Whois Server:", $temp)) {
$server = str_replace("Whois Server: ", "", $temp);
$server = trim($server);
}
}
fclose($sc);
if(($sc = fsockopen($server,43))==false){
//echo"There is a temporary service disruption Please try later";
$layout =2;
print_results($layout);
exit;
}
}
$output="";
fputs($sc,"$domain.$ext\n");
while(!feof($sc)){$output.=fgets($sc,128);}
fclose($sc);
print_whois($output);
}
/******* Function to print the results into your template ************************/
function print_results($layout)
{
global $template,$registerlink,$domain,$ext,$server;
if(!is_file($template)){
print"The template file into which to print the results either does not exist or is
not writeable<br>
please correct this if you are the webmaster of this site<br>
The script can not continue exiting......";
exit;
}
$template = file ($template);
$numtlines = count ($template); //Number of lines in the template
$line = 0;
while (! stristr ($template[$line], "<!--DOMAIN RESULTS-->") && $line < $numtlines) {
echo $template[$line];
$line++;
}
if($layout=="0"){
$line++;
print "<h3>Het domein: \"$domain.$ext\" is vrij!</h3><a href=\"$registerlink?domein=$domain.$ext\" >registreer nu!</a>";
}
elseif($layout=="1"){
$line++;
print "<h3>Het domein: \"$domain.$ext\" is reeds bezet.</h3><font class=main>Bent u de eigenaar van dit domein dan kunt u het naar ons <a href=\"$registerlink?domein=$domain.$ext\" >verhuizen.</a>";
}
elseif($layout=="2"){
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=main>\n";
print "<tr>\n<td>\n<b>\nResultaten voor \"$domain.$ext\"</b>\n<br>\n</td>\n</tr>\n";
print "<tr>\n<td>\n<b>Kan geen verbinding maken met de server $server</b>\n<br>\n</td>\n</tr>\n";
print "</table>\n";
}
else{
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=main>\n";
print "<tr>\n<td>\n<b>Resultaten voor \"$domain.$ext\"</b>\n<br>\n</td>\n</tr>\n";
print $layout;
print "</table>\n";
}
while ($line < $numtlines) {
echo $template[$line];
$line++;
}
}
/******* Function to print whois results *****************************************/
function print_whois($output){
global $template,$domain,$ext;
if(!is_file($template)){
print"The template file into which to print the results either does not exist
or is not writable<br>
please correct this if you are the webmaster of this site<br>
The script can not continue exiting......";
exit;
}
$template = file ($template);
$numtlines = count ($template);
$line = 0;
while (! stristr ($template[$line], "<!--DOMAIN RESULTS-->") && $line < $numtlines) {
echo $template[$line];
$line++;
}
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=font1l>\n";
print "<tr>\n<td>\n<b>\nDomain whois query information for \"$domain.$ext\"</b>\n</td>\n</tr>\n";
print "<tr>\n<td>\n<hr>\n</td>\n</tr>\n";
print "<tr>\n<td>\n";
$output= explode("\n",$output);
foreach ($output as $value){
print "$value<br>\n";
}
}
/****** This checks the name for invaild characters *******************************/
function namecheck($domain)
{
if($domain==""){$layout = "<tr>\n<td>\n<font color=\"red\">\nU moet een domeinnaam invullen om te controleren.</font>\n<br>\n";
print_results($layout);exit;}
if(strlen($domain)< 3){$layout = "<tr>\n<td>\n<font color=\"red\">\nDe domeinnaam $domain is te kort.</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
if(strlen($domain)>57){$layout = "<tr>\n<td>\n<font color=\"red\">\nDe domeinnaam $domain is te lang.</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
if(@ereg("^-|-$",$domain)){$layout = "<tr>\n<td>\n<font color=\"red\">\nDomeinnaam mag niet beginnen met een hyphen</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
if(!ereg("([a-z]|[A-Z]|[0-9]|-){".strlen($domain)."}",$domain))
{$layout = "<tr>\n<td>\n<font color=\"red\">\nDomeinnaam mag geen speciale tekens bevatten.</font>\n</td>\n</tr>\n"; print_results($layout);exit;}
}
/********** function to return whois record via socket ***********************/
function cozawhois($domain){
$errno = 0;
$errostr = "";
$timeout = 30;
$fp = fsockopen("co.za",80,$errno,$errstr,$timeout);
if($fp){
socket_set_timeout($fp,$timeout);
$url = "GET /cgi-bin/whois.sh?Domain=$domain HTTP/1.0\r\n Host: co.za\r\n";
$url .= "Connection: Keep-Alive\r\n User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)\r\n";
$url .= "Referer: http://co.za/whois.shtml\r\n Accept: text/plain, text/html\r\n\r\n";
fputs($fp,$url);
$output = "";
while(!feof($fp)){
$output .= fgets($fp,128);
}
fclose($fp);
$temp_code = strip_tags($output);
$startp = strpos($temp_code,"The CO.ZA simple whois server");
$dis = substr($temp_code,$startp);
print_whois($dis);
}else{
$layout = "<tr>\n<td>\nThe script could not connect to the co.za whois server<br>";
$layout.= "<b>DEBUG INFO:</b><br><br>";
$layout.= "Error No: $errno<br>Error Description:<br>$errstr</td>\n</tr>\n";
print_results($layout);
exit;
}
}
/***<--------------------------------end functions------------------------------------>***/
Gewijzigd op 30/03/2011 22:13:41 door Stef ter Braak
wat moeten wij nou met 888 regels aan code, plaats aub alleen relevante code
Wat is relevant aan dit probleem dan haal ik de rest weg.. p.s. (sorry) ik weet niet waar de fout ligt.
Waarom staat dat uit?
Als deze dicht staat zal het niet gaan werken.
@ Jasper ik kan dat even nakijken inderdaad.. maar hij deed het eerder wel (toen er nog een extra pagina tussen zat. (wat de functie was van deze weet ik niet).
Ik zal dat even nakijken in ieder geval en laat het jullie weten :) Bedankt
Gewijzigd op 31/03/2011 11:10:40 door Stef ter Braak