hulp bij eregi naar preg_match
Wie weet of kan mij de volgende eregi omzetten in een juiste preg_match?
if(eregi($domainInfo[$tld]['nomatch'],strtolower($result)))
Ik ben al drie dagen aan het speuren op inernet zonder resultaat.
Met de gegeven info zal niemand je kunnen helpen. De eerste parameter van eregi is een reguliere expressie. In deze call wordt er echter een variabele meegegeven ($domainInfo[$tld]['nomatch']) en dus moeten we de waarde van die variabele weten. Als je dat niet kan geven zal het niet gaan lukken.
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
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
<?
if($_POST['action'] == "view")
$_GET['action'] = "view";
if(!$_GET['action'] == "view" && ($_POST['domain'] || $_POST['domaintld']))
{
if(strstr($domain, "."))
$userTLD = trim(strtolower(substr($_POST['domain'], strpos($_POST['domain'], ".")+1)));
if($domainInfo[$userTLD])
$_POST['tld'] = $userTLD;
if($_POST['domaintld'])
{
$_POST['domain'] = substr($_POST['domaintld'], 0, strpos($_POST['domaintld'], "."));
$_POST['tld'] = substr($_POST['domaintld'], strpos($_POST['domaintld'], ".")+1);
}
$_POST['tld'] = strtolower($_POST['tld']);
$_POST['domain'] = cleanUpDomain($_POST['domain']);
print "<div id='whoiswait'><div class='outer'><div class='inner'>";
print getLabel("please_wait")."<br />";
if($_POST['tld'] != "all")
print "<strong>www.".$_POST['domain'].".".$_POST['tld']."</strong>";
else
print "<strong>www.".$_POST['domain'].".<span id='whoistld'>com</span></strong>";
if($showProgressPercent)
print "<br /><span id='whoispc'>%</span>";
if($showProgressImage)
print "<br /><img src=\"".$whoisUrl."/images/".(($progressImage) ? $progressImage : "progressbar1.gif")."\" border=\"0\" alt=\"Please Wait\" />";
print "</div></div></div>";
flush();
}
$GLOBAL_DOMAIN = $_POST['domain'];
$_SESSION['whoiscounter'] = 0;
function cleanUpDomain($domain)
{
$domain = strtolower($domain);
$remove = array("http://", "www.", "!", "\"", "£", "$", "%", "^", "*", "(", ")", "+", "=", "{", "}", "[", "]", ":", ";", "@", "'", "~", "#", "<", ",", ">", "?", "/", "¬", "|");
$domain = str_replace($remove, "", trim($domain));
if(strstr($domain, "."))
$domain = substr($domain, 0, strpos($domain, "."));
return trim($domain);
}
function displayResultsTable($results)
{
global $GLOBAL_DOMAIN, $domainInfo, $registerUrl, $showRegisterButton, $whoisUrl;
global $whoisWindowWidth, $whoisWindowHeight, $showPriceColumn;
$results = array_reverse($results, true);
if($_POST['tld'] != "all")
{
if($results[$_POST['tld']] == "available")
{
print "<p>".getLabel("domain_available")."</p>";
}
else if($results[$_POST['tld']] == "adown")
{
print "<p>".getLabel("whois_server_down", false, $_POST['tld'])."</p>";;
}
else
{
print "<p>".getLabel("domain_unavailable")."</p>";
}
}
print "<table id='whoistable' border='0' width='100%' cellpadding='5' cellspacing='0'>\n";
print "<tr>";
print "<th>".getLabel("domain_table_head")."</th>";
print "<th>".getLabel("availability_table_head")."</th>";
if($showPriceColumn) print "<th>".getLabel("price_table_head")."</th>";
print "<th> </th>";
print "</tr>";
$bg = true;
foreach($results as $tld => $result)
{
if($bg)
{
$class = "whoisrow1";
$bg = false;
}
else
{
$class = "whoisrow2";
$bg = true;
}
print "<tr>";
print "<td class=\"".$class."";
if($result == "available") print "available";
print "\">";
if($result != "available") print "<a href=\"http://www.".$GLOBAL_DOMAIN.".".$tld."\" target=\"_blank\">";
print $GLOBAL_DOMAIN.".".$tld;
if($result != "available") print "</a>";
print" </td>";
if($result == "available")
{
print "<td class=\"".$class."available\"><span class=\"domainavailable\">".getLabel("domain_available_short")."</span></td>";
if($showPriceColumn) print "<td class=\"".$class."available\">".getLabel("currency_symbol").number_format(($domainInfo[$tld]['price']), 2)."/".getLabel("year_label")."</td>";
print "<td class=\"".$class."available\">";
if($registerUrl && $showRegisterButton)
print "<input type=\"button\" class=\"linkbutton\" onclick=\"document.location='".str_replace(array("%domain%", "%tld%"), array($GLOBAL_DOMAIN, $tld), $registerUrl)."';\" value=\"".getLabel("register_label")."\" />";
else
print " ";
print "</td>";
}
else if($result == "adown")
{
print "<td class=\"".$class."\"><span class=\"error\">".getLabel("whois_timeout")."</span></td>";
if($showPriceColumn) print "<td class=\"".$class."\">-</td>";
print "<td class=\"".$class."\"><form method=\"post\" action=\"".$whoisUrl."/whois.php?action=view\" target=\"whoisWindow\" class=\"whoisform\" onsubmit=\"whoisDetails('600','400','yes','center');\"><input type=\"hidden\" name=\"tld\" value=\"".$tld."\" /><input type=\"hidden\" name=\"domain\" value=\"".$GLOBAL_DOMAIN."\" /><input class=\"linkbutton\" value=\"Whois\" type=\"submit\" /></form></td>";
}
else
{
print "<td class=\"".$class."\"><span class=\"domaintaken\">".getLabel("domain_unavailable_short")."</span></td>";
if($showPriceColumn) print "<td class=\"".$class."\">-</td>";
print "<td class=\"".$class."\"><form method=\"post\" action=\"".$whoisUrl."/whois.php?action=view\" target=\"whoisWindow\" class=\"whoisform\" onsubmit=\"whoisDetails('600','400','yes','center');\"><input type=\"hidden\" name=\"tld\" value=\"".$tld."\" /><input type=\"hidden\" name=\"domain\" value=\"".$GLOBAL_DOMAIN."\" /><input class=\"linkbutton\" value=\"Whois\" type=\"submit\" /></form></td>";
}
print "</tr>";
}
print "</table>";
}
function whoisStackFull()
{
global $domainInfo;
if(count($_SESSION['whois']) > count($domainInfo))
{
array_shift($_SESSION['whois']);
return false;
}
else
return false;
}
function getWhoisRecords($tld, $domain, $checkoutput=false)
{
global $domainInfo, $showProgressPercent, $useSocket;
$result = "";
$domainCheck = $domain.".".$tld;
if(!$_SESSION['whoiscounter'])
$_SESSION['whoiscounter'] = 0;
if($checkoutput)
{
print "<script type='text/javascript'>if(document.getElementById('whoistld')) document.getElementById('whoistld').innerHTML=\"".$tld."\";</script>\n";
if($showProgressPercent)
{
$pc = number_format((($_SESSION['whoiscounter']+1) / count($domainInfo)) * 100, 0)."%";
//print "Percent: (TOTAL ".count($domainInfo).") CURRENT: ".($_SESSION['whoiscounter']+1)." PC: ".$pc."<hr>";
print "<script type='text/javascript'>if(document.getElementById('whoispc')) document.getElementById('whoispc').innerHTML=\"".$pc."\";</script>\n";
}
flush();
}
$_SESSION['whoiscounter']++;
if($_SESSION['whoiscounter'] == count($domainInfo))
$_SESSION['whoiscounter'] = 0;
if(isset($_SESSION['whois'][$domain][$tld]))
return $_SESSION['whois'][$domain][$tld];
if($useSocket)
{
$ns = fsockopen($domainInfo[$tld]['server'],43,$errno, $errstr, 15);
if($ns)
{
@fputs($ns,"$domainCheck\r\n");
while(@!feof($ns))
$result .= @fgets($ns, 1024);
@fclose($ns);
}
}
else
{
$queryDomain = escapeshellcmd($domainCheck);
$string = "whois -h ".$domainInfo[$tld]['server']." \"".$queryDomain."\"";
exec($string, $resultList);
$result = cleanUpResult($resultList);
}
if($_SESSION['whoiscounter'] == 0)
$_SESSION['cjwhois_searches']++;
if(!$result)
{
if(!whoisStackFull())
$_SESSION['whois'][$domain][$tld] = "adown";
return "adown";
}
/*print "<h1>Raw Result (".$tld.")</h1><pre>";
print $result;
print "</pre><hr>";*/
if(eregi($domainInfo[$tld]['nomatch'],strtolower($result)))
{
if(!whoisStackFull())
$_SESSION['whois'][$domain][$tld] = false;
return false;
}
else
{
if(!whoisStackFull())
$_SESSION['whois'][$domain][$tld] = $result;
return $result;
}
}
function cleanUpResult($resultIn)
{
if(!is_array($resultIn))
return false;
$resultOut = "";
foreach($resultIn as $line)
{
if(!strstr($line, "[") && !strstr($line, "]"))
$resultOut .= $line."\n";
}
return trim($resultOut);
}
function renderTLDList()
{
global $domainInfo;
?>
<select name="tld" size="1">
<option value="all">all</option>
<?
foreach($domainInfo as $tld => $attribs)
{
print "<option value=\"".$tld."\"";
if($_POST['tld'] == $tld)
print " selected";
print ">".$tld."</option>\n";
}
?>
</select>
<?
}
function renderForm($submitText = "Go")
{
?>
<form method="post" class="whoisform" action="<? print $_SERVER['REQUEST_URI']; ?>" onsubmit="return validateDomain(this.domain)"><span style="position:relative;top:-1px;">www.</span><input type="text" name="domain" value="<? print $_POST['domain']; ?>" />.
<?
renderTLDList();
?>
<input type="submit" value="<? print $submitText; ?>" />
</form>
<?
}
function closeWhoisProgress()
{
print "<script type='text/javascript'>\n";
print "if(document.getElementById('whoiswait'))\n";
print " document.getElementById('whoiswait').style.display='none';";
print "</script>\n";
}
function checkTLD($tld)
{
global $domainInfo;
if($tld == "all") return true;
if($domainInfo[$tld])
return true;
else
return false;
}
function getLabel($msg, $domain="", $tld="")
{
global $lang;
if($lang[$msg])
return str_replace(array("%domain%", "%tld%"), array($domain, $tld), $lang[$msg]);
}
?>
if($_POST['action'] == "view")
$_GET['action'] = "view";
if(!$_GET['action'] == "view" && ($_POST['domain'] || $_POST['domaintld']))
{
if(strstr($domain, "."))
$userTLD = trim(strtolower(substr($_POST['domain'], strpos($_POST['domain'], ".")+1)));
if($domainInfo[$userTLD])
$_POST['tld'] = $userTLD;
if($_POST['domaintld'])
{
$_POST['domain'] = substr($_POST['domaintld'], 0, strpos($_POST['domaintld'], "."));
$_POST['tld'] = substr($_POST['domaintld'], strpos($_POST['domaintld'], ".")+1);
}
$_POST['tld'] = strtolower($_POST['tld']);
$_POST['domain'] = cleanUpDomain($_POST['domain']);
print "<div id='whoiswait'><div class='outer'><div class='inner'>";
print getLabel("please_wait")."<br />";
if($_POST['tld'] != "all")
print "<strong>www.".$_POST['domain'].".".$_POST['tld']."</strong>";
else
print "<strong>www.".$_POST['domain'].".<span id='whoistld'>com</span></strong>";
if($showProgressPercent)
print "<br /><span id='whoispc'>%</span>";
if($showProgressImage)
print "<br /><img src=\"".$whoisUrl."/images/".(($progressImage) ? $progressImage : "progressbar1.gif")."\" border=\"0\" alt=\"Please Wait\" />";
print "</div></div></div>";
flush();
}
$GLOBAL_DOMAIN = $_POST['domain'];
$_SESSION['whoiscounter'] = 0;
function cleanUpDomain($domain)
{
$domain = strtolower($domain);
$remove = array("http://", "www.", "!", "\"", "£", "$", "%", "^", "*", "(", ")", "+", "=", "{", "}", "[", "]", ":", ";", "@", "'", "~", "#", "<", ",", ">", "?", "/", "¬", "|");
$domain = str_replace($remove, "", trim($domain));
if(strstr($domain, "."))
$domain = substr($domain, 0, strpos($domain, "."));
return trim($domain);
}
function displayResultsTable($results)
{
global $GLOBAL_DOMAIN, $domainInfo, $registerUrl, $showRegisterButton, $whoisUrl;
global $whoisWindowWidth, $whoisWindowHeight, $showPriceColumn;
$results = array_reverse($results, true);
if($_POST['tld'] != "all")
{
if($results[$_POST['tld']] == "available")
{
print "<p>".getLabel("domain_available")."</p>";
}
else if($results[$_POST['tld']] == "adown")
{
print "<p>".getLabel("whois_server_down", false, $_POST['tld'])."</p>";;
}
else
{
print "<p>".getLabel("domain_unavailable")."</p>";
}
}
print "<table id='whoistable' border='0' width='100%' cellpadding='5' cellspacing='0'>\n";
print "<tr>";
print "<th>".getLabel("domain_table_head")."</th>";
print "<th>".getLabel("availability_table_head")."</th>";
if($showPriceColumn) print "<th>".getLabel("price_table_head")."</th>";
print "<th> </th>";
print "</tr>";
$bg = true;
foreach($results as $tld => $result)
{
if($bg)
{
$class = "whoisrow1";
$bg = false;
}
else
{
$class = "whoisrow2";
$bg = true;
}
print "<tr>";
print "<td class=\"".$class."";
if($result == "available") print "available";
print "\">";
if($result != "available") print "<a href=\"http://www.".$GLOBAL_DOMAIN.".".$tld."\" target=\"_blank\">";
print $GLOBAL_DOMAIN.".".$tld;
if($result != "available") print "</a>";
print" </td>";
if($result == "available")
{
print "<td class=\"".$class."available\"><span class=\"domainavailable\">".getLabel("domain_available_short")."</span></td>";
if($showPriceColumn) print "<td class=\"".$class."available\">".getLabel("currency_symbol").number_format(($domainInfo[$tld]['price']), 2)."/".getLabel("year_label")."</td>";
print "<td class=\"".$class."available\">";
if($registerUrl && $showRegisterButton)
print "<input type=\"button\" class=\"linkbutton\" onclick=\"document.location='".str_replace(array("%domain%", "%tld%"), array($GLOBAL_DOMAIN, $tld), $registerUrl)."';\" value=\"".getLabel("register_label")."\" />";
else
print " ";
print "</td>";
}
else if($result == "adown")
{
print "<td class=\"".$class."\"><span class=\"error\">".getLabel("whois_timeout")."</span></td>";
if($showPriceColumn) print "<td class=\"".$class."\">-</td>";
print "<td class=\"".$class."\"><form method=\"post\" action=\"".$whoisUrl."/whois.php?action=view\" target=\"whoisWindow\" class=\"whoisform\" onsubmit=\"whoisDetails('600','400','yes','center');\"><input type=\"hidden\" name=\"tld\" value=\"".$tld."\" /><input type=\"hidden\" name=\"domain\" value=\"".$GLOBAL_DOMAIN."\" /><input class=\"linkbutton\" value=\"Whois\" type=\"submit\" /></form></td>";
}
else
{
print "<td class=\"".$class."\"><span class=\"domaintaken\">".getLabel("domain_unavailable_short")."</span></td>";
if($showPriceColumn) print "<td class=\"".$class."\">-</td>";
print "<td class=\"".$class."\"><form method=\"post\" action=\"".$whoisUrl."/whois.php?action=view\" target=\"whoisWindow\" class=\"whoisform\" onsubmit=\"whoisDetails('600','400','yes','center');\"><input type=\"hidden\" name=\"tld\" value=\"".$tld."\" /><input type=\"hidden\" name=\"domain\" value=\"".$GLOBAL_DOMAIN."\" /><input class=\"linkbutton\" value=\"Whois\" type=\"submit\" /></form></td>";
}
print "</tr>";
}
print "</table>";
}
function whoisStackFull()
{
global $domainInfo;
if(count($_SESSION['whois']) > count($domainInfo))
{
array_shift($_SESSION['whois']);
return false;
}
else
return false;
}
function getWhoisRecords($tld, $domain, $checkoutput=false)
{
global $domainInfo, $showProgressPercent, $useSocket;
$result = "";
$domainCheck = $domain.".".$tld;
if(!$_SESSION['whoiscounter'])
$_SESSION['whoiscounter'] = 0;
if($checkoutput)
{
print "<script type='text/javascript'>if(document.getElementById('whoistld')) document.getElementById('whoistld').innerHTML=\"".$tld."\";</script>\n";
if($showProgressPercent)
{
$pc = number_format((($_SESSION['whoiscounter']+1) / count($domainInfo)) * 100, 0)."%";
//print "Percent: (TOTAL ".count($domainInfo).") CURRENT: ".($_SESSION['whoiscounter']+1)." PC: ".$pc."<hr>";
print "<script type='text/javascript'>if(document.getElementById('whoispc')) document.getElementById('whoispc').innerHTML=\"".$pc."\";</script>\n";
}
flush();
}
$_SESSION['whoiscounter']++;
if($_SESSION['whoiscounter'] == count($domainInfo))
$_SESSION['whoiscounter'] = 0;
if(isset($_SESSION['whois'][$domain][$tld]))
return $_SESSION['whois'][$domain][$tld];
if($useSocket)
{
$ns = fsockopen($domainInfo[$tld]['server'],43,$errno, $errstr, 15);
if($ns)
{
@fputs($ns,"$domainCheck\r\n");
while(@!feof($ns))
$result .= @fgets($ns, 1024);
@fclose($ns);
}
}
else
{
$queryDomain = escapeshellcmd($domainCheck);
$string = "whois -h ".$domainInfo[$tld]['server']." \"".$queryDomain."\"";
exec($string, $resultList);
$result = cleanUpResult($resultList);
}
if($_SESSION['whoiscounter'] == 0)
$_SESSION['cjwhois_searches']++;
if(!$result)
{
if(!whoisStackFull())
$_SESSION['whois'][$domain][$tld] = "adown";
return "adown";
}
/*print "<h1>Raw Result (".$tld.")</h1><pre>";
print $result;
print "</pre><hr>";*/
if(eregi($domainInfo[$tld]['nomatch'],strtolower($result)))
{
if(!whoisStackFull())
$_SESSION['whois'][$domain][$tld] = false;
return false;
}
else
{
if(!whoisStackFull())
$_SESSION['whois'][$domain][$tld] = $result;
return $result;
}
}
function cleanUpResult($resultIn)
{
if(!is_array($resultIn))
return false;
$resultOut = "";
foreach($resultIn as $line)
{
if(!strstr($line, "[") && !strstr($line, "]"))
$resultOut .= $line."\n";
}
return trim($resultOut);
}
function renderTLDList()
{
global $domainInfo;
?>
<select name="tld" size="1">
<option value="all">all</option>
<?
foreach($domainInfo as $tld => $attribs)
{
print "<option value=\"".$tld."\"";
if($_POST['tld'] == $tld)
print " selected";
print ">".$tld."</option>\n";
}
?>
</select>
<?
}
function renderForm($submitText = "Go")
{
?>
<form method="post" class="whoisform" action="<? print $_SERVER['REQUEST_URI']; ?>" onsubmit="return validateDomain(this.domain)"><span style="position:relative;top:-1px;">www.</span><input type="text" name="domain" value="<? print $_POST['domain']; ?>" />.
<?
renderTLDList();
?>
<input type="submit" value="<? print $submitText; ?>" />
</form>
<?
}
function closeWhoisProgress()
{
print "<script type='text/javascript'>\n";
print "if(document.getElementById('whoiswait'))\n";
print " document.getElementById('whoiswait').style.display='none';";
print "</script>\n";
}
function checkTLD($tld)
{
global $domainInfo;
if($tld == "all") return true;
if($domainInfo[$tld])
return true;
else
return false;
}
function getLabel($msg, $domain="", $tld="")
{
global $lang;
if($lang[$msg])
return str_replace(array("%domain%", "%tld%"), array($domain, $tld), $lang[$msg]);
}
?>
- Aar -:
Gelieve in het vervolg bij code de [code][/code]-tags gebruiken.
Alvast bedankt!
Alvast bedankt!
Gewijzigd op 06/06/2014 16:43:03 door - Ariën -
LET OP: dit zal je script stoppen en alleen een regel naar het scherm printen met daarin de waarde van de benodigde variabele. Doe dit dus bij voorkeur in een test omgeving. Kan het alleen in je productie omgeving dan moet je die regel direct weer weghalen zodra je de gegevens hebt, en het script opnieuw opslaan.
Misschien dat ik er overheen kijk maar ik kan nergens iets vinden waar de array "domainInfo" waarden krijgt. Zonder deze info wordt het lastig helpen.
Ik heb iets gevonden met die domaininfo
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
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
$domainInfo = array(
/*
"xxx" => array(
"server"=>"whois.example.commented.out"
"nomatch"=>"no match",
"price"=>10.99,
),
*/
"nl" => array(
"server"=>"whois.sidn.nl","whois.domain-registry.nl",
"nomatch"=>"free",
"price"=>19.99,
),
"be" => array(
"server"=>"whois.dns.be",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
"com" => array(
"server"=>"whois.crsnic.net",
"nomatch"=>"no match",
"price"=>12.99,
),
"eu" => array(
"server"=>"whois.eu",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
);
/*
"xxx" => array(
"server"=>"whois.example.commented.out"
"nomatch"=>"no match",
"price"=>10.99,
),
*/
"nl" => array(
"server"=>"whois.sidn.nl","whois.domain-registry.nl",
"nomatch"=>"free",
"price"=>19.99,
),
"be" => array(
"server"=>"whois.dns.be",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
"com" => array(
"server"=>"whois.crsnic.net",
"nomatch"=>"no match",
"price"=>12.99,
),
"eu" => array(
"server"=>"whois.eu",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
);
Toevoeging op 06/06/2014 17:07:19:
ik krijg namelijk de volgende fout steeds.
Deprecated: Function eregi() is deprecated in
en na lang zoeken blijkt dat de server blokt en dat ik preg_match moet gebruiken. Maar hoe dit werkt????Voor mij abracadabra
strpos. Je zoekt namelijk alleen maar of een bepaalde string te vinden is in een andere. Dat is het beste met strpos. Dan zou je dit krijgen:
Toevoeging op 06/06/2014 17:12:18:
Even ter verduidelijking, voor ik het ook verkeerd lees, je gaat nu de if constructie in als de 'no match' oid gevonden is in de string.
Dan zou ik deze specifieke eregi call niet vervangen met een preg_match, maar een Code (php)
1
2
3
2
3
<?php
if ( strpos( strtolower( $result ), $domainInfo[$tld]['nomatch'] ) !== false ){
?>
if ( strpos( strtolower( $result ), $domainInfo[$tld]['nomatch'] ) !== false ){
?>
Toevoeging op 06/06/2014 17:12:18:
Even ter verduidelijking, voor ik het ook verkeerd lees, je gaat nu de if constructie in als de 'no match' oid gevonden is in de string.
Toevoeging op 06/06/2014 17:31:12:
Na het invoegen krijg ik nu deze melding
Parse error: syntax error, unexpected T_ELSE
Geef eens die regel met de IF tot en met die ELSE
Ik ga hem nu even goed testen.
Bedankt alvast voor de snelle en goede hulp
Toevoeging op 06/06/2014 18:50:24:
Bij het testen krijg ik geen fout meldingen meer.
Alleen bij het zoeken naar een domeinnaam krijg ik van de be en de eu servers altijd bezet. terwijl ze beschikbaar zijn.
Iemand toevallig de juiste servers voor be en eu?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"be" => array(
"server"=>"whois.dns.be",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
"com" => array(
"server"=>"whois.crsnic.net",
"nomatch"=>"no match",
"price"=>12.99,
),
"eu" => array(
"server"=>"whois.eu",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
"server"=>"whois.dns.be",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
"com" => array(
"server"=>"whois.crsnic.net",
"nomatch"=>"no match",
"price"=>12.99,
),
"eu" => array(
"server"=>"whois.eu",
"nomatch"=>"AVAILABLE",
"price"=>19.99,
),
Toevoeging op 06/06/2014 19:11:50:
Schijnbaar komt het toch door die nieuwe regel. Want met de oude eregi laat hij de be wel goed zien.
Code (php)
1
2
3
2
3
<?php
if ( strpos( strtolower( $result ), strtolower( $domainInfo[$tld]['nomatch'] ) ) !== false )
?>
if ( strpos( strtolower( $result ), strtolower( $domainInfo[$tld]['nomatch'] ) ) !== false )
?>
Ik zal even kort uitleggen:
Het begon met onderstaande regel met eregi waar ik fouten kreeg.
Vervolgens met deze gekregen regel aangepast maar alle be en eu namen steeds bezet terwijl ze vrij zijn
Vervolgens onderstaande code en zelfs AVAILABLE en available geprobeerd. Maar nu zijn alle be en eu domeinen vrij terwijl die weer bezet zouden zijn.
Code (php)
1
if if ( strpos( strtolower( $result ), strtolower( $domainInfo[$tld]['nomatch'] ) ) !== false )
Ik hoop dat er iemand is die de oplossing heeft.
Als jullie meer informatie nodig hebben dan laat me dat weten
Misschien handig op $result ook eens te echo-en