View difference between Paste ID: csWzSuUq and A3SWirMY
SHOW: | | - or go back to the newest paste.
1
<?PHP 
2-
$ArrPageModule['166']=array(
2+
$ArrServerNumrical['166']=array(
3
	"Path"=>"files",
4
	"FileName"=>"166"
5
);
6
$ArrSuperServerNumrical['60']=array(
7
	"Path"=>"files",
8
	"FileName"=>"ss60"
9
);
10-
$ArrPageModule['166']=array(
10+
11
Too add a file to the list of arrays
12
simple create the file in dir 'files'
13
copy this:
14-
Change $ArrPageModule to what you want user to type to see coords,
14+
$ArrServerNumrical['166']=array(
15
	"Path"=>"files",
16
	"FileName"=>"166"
17
);	
18
Change $ArrServerNumrical to what you want user to type to see coords,
19
and change FileName to the name of the file you created 
20-
	$isSuperServer=$_GET['ss'];
20+
21
22-
	$isSuperServer=$_GET['ss'];
22+
23
if (!isset($_GET['s'])){
24
	echo "<h2>Please choose your server number.</h2>";
25
	echo "<head><title>Evony map :: DrWhat Project ::0.0.4 </title></head>
26-
	$_GET['s']=1;
26+
27-
	$PageModule=$_GET['s'];
27+
28
<hr><form action=\"map.php\" method=\get\">
29
 <fieldset>
30
  Server Number <input type=\"text\" name=\"s\"><br>
31
  Super Server? <input type=\"radio\" name=\"ss\" id=\"ss\" value=1><br>
32
  <input type=\"submit\" value=\"Submit\">
33
 </fieldset>
34
</form> <hr>TODO:</br>
35
Find subtitle software to scan all servers speedy,</br>
36
CSS,</br>
37
JS table formatting</br>
38
Add search</br>
39
Run off MySQL database rather then a CVS file</br></br></br><hr>
40
Any suggestions Email <a>[email protected]</a>";
41
}
42
if (!isset($_GET['ss'])){
43
	$_GET['ss']=0;
44
	$isSuperServer=0;
45-
$PageModule=strip_tags($_GET['s']);
45+
	echo "hello";// Oh dear im stuck :3
46
}
47-
if ( array_key_exists($PageModule,$ArrPageModule)){
47+
$isSuperServer=$_GET['ss'];
48-
	$RequireFile = $ArrPageModule[$PageModule]['Path'].'/'.$ArrPageModule[$PageModule]['FileName'].'.csv';
48+
49
$ServerNumrical=strip_tags($_GET['s']);
50-
else {
50+
switch ($isSuperServer) {
51-
	$PageErrorId = 1;
51+
	case 0;
52-
	exit();
52+
		if ( array_key_exists($ServerNumrical,$ArrServerNumrical)){
53
			$RequireFile = $ArrServerNumrical[$ServerNumrical]['Path'].'/'.$ArrServerNumrical[$ServerNumrical]['FileName'].'.csv';
54
		}else {
55
			$PageErrorId = 1;
56-
<title>Evony map :: DrWhat Project ::0.0.4 </title>
56+
			exit();
57
		}
58
	case 1;
59
		if ( array_key_exists($ServerNumrical,$ArrSuperServerNumrical)){
60
			$RequireFile = $ArrSuperServerNumrical[$ServerNumrical]['Path'].'/'.$ArrSuperServerNumrical[$ServerNumrical]['FileName'].'.csv';
61
		}else {
62
			$PageErrorId = 1;
63
			exit();
64
		}
65
	break;
66
}
67
	
68
?>
69
<head>
70
<title>Evony map :: DrWhat Project ::0.0.4.2 </title>
71
</head>
72
<body>
73
<h3> This is a DrWhat project, this project is protect under the <a href="http://www.gnu.org/licenses/gpl.html">GNU GENERAL PUBLIC LICENSE Version 3</a></h3>
74
<hr><form action="map.php" method="get">
75
 <fieldset>
76
  Server Number <input type="text" name="s"><br>
77-
echo "You are viewing Coordenates for server ".$PageModule.". </br> Download full list by <a href='".$RequireFile."'>clicking here</a>";
77+
78
  <input type="submit" value="Submit">
79
 </fieldset>
80
</form> <hr>
81
TODO:</br>
82
Find subtitle software to scan all servers speedy,</br>
83
CSS,</br>
84
JS table formatting</br>
85
Add search</br>
86
Run off MySQL database rather then a CVS file</br>
87
</br></br>
88
89
<?php if (empty($RequireFile)){
90
}else{
91
echo "You are viewing Coordenates for server ".$ServerNumrical.". </br> Download full list by <a href='".$RequireFile."'>clicking here</a>";
92
}
93
?></br><hr>
94
Any suggestions Email: [email protected]
95
<table></br>
96
<thead>
97
<tr>
98
<th>X |</th>
99
<th> Y |</th>
100
<th> City Name |</th>
101
<th> Lord Name |</th>
102
<th> Allaince |</th>
103
<th> Status |</th>
104
<th> Flag |</th>
105
<th> Honor |</th>
106
<th> Prestige |</th>
107
<th> Disposition</th>
108
</tr>
109
</thead>
110
<tbody>
111
<?PHP
112
if (empty($RequireFile)){
113
  }else{
114
   if (($handle = fopen($RequireFile, "r")) !== FALSE) {
115
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
116
    {
117
    echo '<tr>';
118
    for ($c=0; $c < count($data); $c++)
119
    {
120
    echo "<td>{$data[$c]}</td>";
121
    }
122
    echo '</tr>';
123
    }
124
    fclose($handle);
125
	}
126
  }
127
?>
128
</tbody>
129
</table> 
130
</body>