-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.php
More file actions
91 lines (74 loc) · 2.59 KB
/
script.php
File metadata and controls
91 lines (74 loc) · 2.59 KB
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
<?php
ini_set('max_execution_time', 300);
include('DomainFinder.class.php');
include('Validate.class.php');
include('config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DomainFinder</title>
<link href="css/app.css" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="post">
<fieldset>
<legend>Options</legend>
<label for="min-length">Min Length</label>
<input id="min-length" name="min-length" type="number" value="3">
<label for="max-length">Max Length</label>
<input id="max-length" name="max-length" type="number" value="8">
</fieldset>
<fieldset>
<legend>Tld</legend>
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
<div class="optionHolder">
<?php
foreach ( $initTlds as $tld )
{
echo '<div class="option"><input type="checkbox" name="options[]" value="'.$tld.'"/> '.$tld . '</div>';
}
?>
</div>
</fieldset>
<fieldset>
<legend>Language</legend>
<div class="optionHolder">
<?php
foreach ( $initLangs as $lang )
{
$path = $lang;
$file = basename($path); // $file is set to "index.php"
$file = basename($path, ".txt"); // $file is set to "index"
echo '<div class="option"><input type="checkbox" name="language[]" value="'.$lang.'"/> '.$file. '</div>';
}
?>
<input class="submit" type="submit" value="Search!" />
</div>
</fieldset>
</form>
<?php
if (!empty($_POST)) {
$val = new Validate($_POST);
$tlds = $val->basic('options');
$chooseLang = $val->basic('language');
$maxSize = $val->basic('max-length');
$minSize = $val->basic('min-length');
foreach ($chooseLang as $lang) {
$words = file($lang);
$domain = new DomainFinder( $tlds, $words, $maxSize, $minSize );
echo '<div id="results">';
echo "<h1>Finding <b>[". implode(", ",$tlds) ."]</b> in " . $lang . "</h1>";
$domain->giveResults();
echo '</div>';
}
} else {
echo "<h2>Choose options and click Go</h2>";
}
?>
</body>
</html>