Permalink
Browse files

add.php and form for it

  • Loading branch information...
1 parent 7a01d51 commit 0f60ae77440fc499c585cad19f4197fa787d9228 @shish committed Sep 26, 2010
Showing with 26 additions and 0 deletions.
  1. +15 −0 htdocs/add.php
  2. +11 −0 htdocs/index.php
View
@@ -0,0 +1,15 @@
+<pre>
+<?php
+if(
+ preg_match("/^[a-z0-9\.]+$/", $_GET["server"]) &&
+ preg_match("/^[A-Za-z ]+$/", $_GET["country"])
+) {
+ $server = $_POST["server"];
+ $country = $_POST["country"];
+ $num = time();
+ print "adding $country / $server\n";
+ chdir("/home/shish/travmap.shishnet.org/utils/");
+ system("./add_server $server '$country' $num");
+}
+?>
+</pre>
View
@@ -299,6 +299,17 @@ function wwwcmp($a, $b) {
<hr>
+<form action="add.php" method="GET">
+<table>
+ <tr><td colspan="2">Add Server</td></tr>
+ <tr><td>Server</td><td><input type="text" name="server" placeholder="e.g. s3.travian.com" pattern="[a-z0-9\.]+"></td></tr>
+ <tr><td>Country</td><td><input type="text" name="country" placeholder="e.g. America"></td></tr>
+ <tr><td colspan="2"><input type="submit"></td></tr>
+</table>
+</form>
+
+<hr>
+
<p><small>
<?=$langs;?>
<br>

0 comments on commit 0f60ae7

Please sign in to comment.